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

Размер файла: 621B
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. use App\Migrations\Migration;
  6. use Illuminate\Database\Schema\Blueprint;
  7.  
  8. final class CreateSettingsTable extends Migration
  9. {
  10. /**
  11. * Migrate Up.
  12. */
  13. public function up(): void
  14. {
  15. if (! $this->schema->hasTable('settings')) {
  16. $this->schema->create('settings', function (Blueprint $table) {
  17. $table->string('name', 25)->primary();
  18. $table->string('value');
  19. });
  20. }
  21. }
  22.  
  23. /**
  24. * Migrate Down.
  25. */
  26. public function down(): void
  27. {
  28. $this->schema->dropIfExists('settings');
  29. }
  30. }