feat(website-type): add footer logo support in WebsiteType model, controller, and resource; update seeder and tests
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('website_type', function (Blueprint $table): void {
|
||||
$table->unsignedBigInteger('footer_logo')->nullable()->after('site_logo');
|
||||
|
||||
$table->foreign('footer_logo')
|
||||
->references('id')
|
||||
->on('attachments')
|
||||
->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('website_type', function (Blueprint $table): void {
|
||||
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
|
||||
$table->dropForeign(['footer_logo']);
|
||||
}
|
||||
|
||||
$table->dropColumn('footer_logo');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user