diff --git a/assets/migrations/2019_09_15_000010_create_tenants_table.php b/assets/migrations/2019_09_15_000010_create_tenants_table.php index f38d248b..fb2eee55 100644 --- a/assets/migrations/2019_09_15_000010_create_tenants_table.php +++ b/assets/migrations/2019_09_15_000010_create_tenants_table.php @@ -13,10 +13,10 @@ class CreateTenantsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('tenants', function (Blueprint $table) { - $table->string('id', 36)->primary(); // 36 characters is the default uuid length + $table->uuid('id')->primary(); // (optional) your custom, indexed columns can go here $table->json('data'); @@ -28,8 +28,8 @@ class CreateTenantsTable extends Migration * * @return void */ - public function down() + public function down(): void { - Schema::drop('tenants'); + Schema::dropIfExists('tenants'); } } diff --git a/assets/migrations/2019_09_15_000020_create_domains_table.php b/assets/migrations/2019_09_15_000020_create_domains_table.php index 5ca592af..886594e7 100644 --- a/assets/migrations/2019_09_15_000020_create_domains_table.php +++ b/assets/migrations/2019_09_15_000020_create_domains_table.php @@ -13,11 +13,11 @@ class CreateDomainsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('domains', function (Blueprint $table) { $table->string('domain', 255)->primary(); - $table->string('tenant_id', 36); + $table->uuid('tenant_id'); $table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade')->onDelete('cascade'); }); @@ -28,8 +28,8 @@ class CreateDomainsTable extends Migration * * @return void */ - public function down() + public function down(): void { - Schema::drop('domains'); + Schema::dropIfExists('domains'); } }