Просмотр файла database/migrations/20180420180041_create_settings_table.php

Размер файла: 621B
<?php

declare(strict_types=1);

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

final class CreateSettingsTable extends Migration
{
    /**
     * Migrate Up.
     */
    public function up(): void
    {
        if (! $this->schema->hasTable('settings')) {
            $this->schema->create('settings', function (Blueprint $table) {
                $table->string('name', 25)->primary();
                $table->string('value');
            });
        }
    }

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