feat(category): add banner functionality to categories with related resource and migration tests

This commit is contained in:
2026-10-01 14:29:31 -03:00
parent 675d76fcb0
commit 5ddc304435
7 changed files with 212 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
<?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('categorias', function (Blueprint $table): void {
$table->foreignId('banner_id')
->nullable()
->constrained('attachments')
->nullOnDelete();
$table->boolean('banner_enabled')->default(false);
});
}
public function down(): void
{
Schema::table('categorias', function (Blueprint $table): void {
$table->dropConstrainedForeignId('banner_id');
$table->dropColumn('banner_enabled');
});
}
};