feat(category): add banner functionality to categories with related resource and migration tests
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user