Просмотр файла database/migrations/20180420180032_create_online_table.php

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