feat: implement tenant management system with attachment support and bootstrap controller
This commit is contained in:
@@ -20,8 +20,8 @@ return new class extends Migration
|
||||
$table->string('secondary_color')->nullable();
|
||||
$table->string('danger_color')->nullable();
|
||||
$table->string('header_footer_bg_color')->nullable();
|
||||
$table->string('header_logo')->nullable();
|
||||
$table->string('footer_logo')->nullable();
|
||||
$table->unsignedBigInteger('header_logo_id')->nullable();
|
||||
$table->unsignedBigInteger('footer_logo_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,6 +28,18 @@ return new class extends Migration
|
||||
$table->index('type');
|
||||
$table->index('mime_type');
|
||||
});
|
||||
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->foreign('header_logo_id')
|
||||
->references('id')
|
||||
->on('attachments')
|
||||
->nullOnDelete();
|
||||
|
||||
$table->foreign('footer_logo_id')
|
||||
->references('id')
|
||||
->on('attachments')
|
||||
->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,6 +47,11 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->dropForeign(['header_logo_id']);
|
||||
$table->dropForeign(['footer_logo_id']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('attachments');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user