feat(tenant): add main carousel images functionality with migration, model, and tests

This commit is contained in:
2026-07-23 14:19:00 -03:00
parent e778d862ba
commit 67ede1a2b4
9 changed files with 241 additions and 12 deletions

View File

@@ -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::create('tenant_main_carousel_images', function (Blueprint $table): void {
$table->id();
$table->foreignId('tenant_id')
->constrained('tenants')
->cascadeOnDelete();
$table->foreignId('attachment_id')
->constrained('attachments')
->cascadeOnDelete();
$table->unsignedInteger('orden')->default(0);
$table->timestamps();
$table->unique(['tenant_id', 'attachment_id']);
$table->index(['tenant_id', 'orden']);
});
}
public function down(): void
{
Schema::dropIfExists('tenant_main_carousel_images');
}
};