string('slug')->primary(); $table->string('name'); $table->timestamps(); }); Schema::create('cost_units', function (Blueprint $table) { $table->id(); $table->string('tenant'); $table->string('name'); $table->string('type'); $table->dateTime('billing_deadline'); $table->float('distance_allowance'); $table->boolean('mail_on_new')->default(true); $table->boolean('allow_new')->default(true); $table->boolean('archived')->default(false); $table->string('treasurers'); $table->foreign('tenant')->references('slug')->on('tenants')->cascadeOnDelete()->cascadeOnUpdate(); $table->foreign('type')->references('slug')->on('cost_unit_types')->cascadeOnDelete()->cascadeOnUpdate(); $table->timestamps(); }); } public function down(): void { Schema::dropIfExists('cost_units'); Schema::dropIfExists('cost_unit_types'); } };