Просмотр файла database/migrations/2018_04_20_180004_create_blacklist_table.php

Размер файла: 866B
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. use Illuminate\Database\Migrations\Migration;
  6. use Illuminate\Database\Schema\Blueprint;
  7. use Illuminate\Support\Facades\Schema;
  8.  
  9. final class CreateBlacklistTable extends Migration
  10. {
  11. /**
  12. * Migrate Up.
  13. */
  14. public function up(): void
  15. {
  16. if (! Schema::hasTable('blacklist')) {
  17. Schema::create('blacklist', function (Blueprint $table) {
  18. $table->increments('id');
  19. $table->string('type', 30);
  20. $table->string('value', 100);
  21. $table->integer('user_id');
  22. $table->integer('created_at');
  23.  
  24. $table->index('type');
  25. $table->index('value');
  26. });
  27. }
  28. }
  29.  
  30. /**
  31. * Migrate Down.
  32. */
  33. public function down(): void
  34. {
  35. Schema::dropIfExists('blacklist');
  36. }
  37. }