2019_09_15_000010_create_tenants_table.php 910 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. declare(strict_types=1);
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6. class CreateTenantsTable extends Migration
  7. {
  8. /**
  9. * Get the migration connection name.
  10. */
  11. public function getConnection(): ?string
  12. {
  13. return config('tenancy.database.central_connection');
  14. }
  15. /**
  16. * Run the migrations.
  17. *
  18. * @return void
  19. */
  20. public function up(): void
  21. {
  22. Schema::create('tenants', function (Blueprint $table) {
  23. $table->string('id')->primary();
  24. // your custom columns may go here
  25. $table->timestamps();
  26. $table->json('data')->nullable();
  27. });
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down(): void
  35. {
  36. Schema::dropIfExists('tenants');
  37. }
  38. }