feat(tenant): add main carousel images functionality with migration, model, 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::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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user