feat: add migration to expand tenant_codigo in bundles and update related seeders and tests
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user