2018-10-09 02:38:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class CreatePollsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('polls', function (Blueprint $table) {
|
|
|
|
$table->char('id', 6);
|
|
|
|
$table->string('question');
|
2018-10-12 18:54:48 +02:00
|
|
|
$table->enum('duplicate_vote_checking', ['none', 'cookies', 'codes']);
|
|
|
|
$table->boolean('allow_multiple_answers');
|
2018-10-12 19:34:05 +02:00
|
|
|
$table->boolean('hide_results_until_closed');
|
2018-10-09 02:38:16 +02:00
|
|
|
$table->timestamp('created_at');
|
|
|
|
$table->timestamp('closes_at')->nullable();
|
|
|
|
$table->string('admin_password')->nullable();
|
|
|
|
|
|
|
|
$table->primary('id');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('polls');
|
|
|
|
}
|
|
|
|
}
|