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

Размер файла: 969B
  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 CreateChatsTable extends Migration
  10. {
  11. /**
  12. * Migrate Up.
  13. */
  14. public function up(): void
  15. {
  16. if (! Schema::hasTable('chats')) {
  17. Schema::create('chats', function (Blueprint $table) {
  18. $table->increments('id');
  19. $table->integer('user_id');
  20. $table->text('text');
  21. $table->ipAddress('ip');
  22. $table->string('brow', 25);
  23. $table->integer('edit_user_id')->nullable();
  24. $table->integer('updated_at')->nullable();
  25. $table->integer('created_at');
  26.  
  27. $table->index('created_at');
  28. });
  29. }
  30. }
  31.  
  32. /**
  33. * Migrate Down.
  34. */
  35. public function down(): void
  36. {
  37. Schema::dropIfExists('chats');
  38. }
  39. }