pollthingy/database/migrations/2018_10_03_224516_create_po...

39 lines
897 B
PHP
Raw Normal View History

<?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');
$table->enum('type', ['cookies', 'codes']);
$table->boolean('multiple_answers_allowed');
$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');
}
}