feat(website-type): add presentation fields and site logo relationship to WebsiteType model

This commit is contained in:
2026-07-31 11:39:17 -03:00
parent cf2beb2ff5
commit 3968a10f6a
6 changed files with 135 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
<?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->string('primary_color')->nullable()->after('nombre');
$table->string('secondary_color')->nullable()->after('primary_color');
$table->string('danger_color')->nullable()->after('secondary_color');
$table->string('success_color')->nullable()->after('danger_color');
$table->unsignedBigInteger('site_logo')->nullable()->after('success_color');
$table->foreign('site_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(['site_logo']);
}
$table->dropColumn([
'primary_color',
'secondary_color',
'danger_color',
'success_color',
'site_logo',
]);
});
}
};