Файл: database/migrations/2018_04_20_180050_create_votes_table.php
Строк: 30
<?php
declare(strict_types=1);
use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
final class CreateVotesTable extends Migration
{
/**
* Migrate Up.
*/
public function up(): void
{
if (! Schema::hasTable('votes')) {
Schema::create('votes', function (Blueprint $table) {
$table->increments('id');
$table->string('title', 100);
$table->text('description')->nullable();
$table->integer('count')->default(0);
$table->boolean('closed')->default(false);
$table->integer('created_at');
$table->integer('topic_id')->nullable();
});
}
}
/**
* Migrate Down.
*/
public function down(): void
{
Schema::dropIfExists('votes');
}
}