View file database/migrations/20180420180021_create_ignoring_table.php

File size: 842B
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. use App\Migrations\Migration;
  6. use Illuminate\Database\Schema\Blueprint;
  7.  
  8. final class CreateIgnoringTable extends Migration
  9. {
  10. /**
  11. * Migrate Up.
  12. */
  13. public function up(): void
  14. {
  15. if (! $this->schema->hasTable('ignoring')) {
  16. $this->schema->create('ignoring', function (Blueprint $table) {
  17. $table->increments('id');
  18. $table->integer('user_id');
  19. $table->integer('ignore_id');
  20. $table->text('text')->nullable();
  21. $table->integer('created_at');
  22.  
  23. $table->index('user_id');
  24. $table->index('created_at');
  25. });
  26. }
  27. }
  28.  
  29. /**
  30. * Migrate Down.
  31. */
  32. public function down(): void
  33. {
  34. $this->schema->dropIfExists('ignoring');
  35. }
  36. }