feat: add migration to expand tenant_codigo in bundles and update related seeders and tests

This commit is contained in:
2026-07-17 16:07:33 -03:00
parent b8eb71896c
commit d3182fbd13
5 changed files with 233 additions and 61 deletions

View File

@@ -0,0 +1,32 @@
<?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('bundles', function (Blueprint $table) {
$table->dropForeign(['tenant_codigo']);
});
Schema::table('bundles', function (Blueprint $table) {
$table->string('tenant_codigo')->change();
$table->foreign('tenant_codigo')->references('codigo')->on('tenants')->onDelete('cascade');
});
}
public function down(): void
{
Schema::table('bundles', function (Blueprint $table) {
$table->dropForeign(['tenant_codigo']);
});
Schema::table('bundles', function (Blueprint $table) {
$table->string('tenant_codigo', 10)->change();
$table->foreign('tenant_codigo')->references('codigo')->on('tenants')->onDelete('cascade');
});
}
};