View file database/migrations/20180420180040_create_rules_table.php

File size: 640B
<?php

declare(strict_types=1);

use App\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

final class CreateRulesTable extends Migration
{
    /**
     * Migrate Up.
     */
    public function up(): void
    {
        if (! $this->schema->hasTable('rules')) {
            $this->schema->create('rules', function (Blueprint $table) {
                $table->increments('id');
                $table->text('text');
                $table->integer('created_at');
            });
        }
    }

    /**
     * Migrate Down.
     */
    public function down(): void
    {
        $this->schema->dropIfExists('rules');
    }
}