This commit is contained in:
lizandrogd
2026-01-19 20:44:11 -05:00
parent 3e3f4bf581
commit 273689627c
2 changed files with 48 additions and 6 deletions
@@ -15,8 +15,8 @@ return new class extends Migration
// Primero hacer la columna nullable si no lo es
$table->unsignedBigInteger('producto_id')->nullable()->change();
// Eliminar la clave foránea existente usando el nombre exacto
$table->dropForeign('detalle_ventas_producto_id_foreign');
// Eliminar la clave foránea existente (compatible con SQLite y MySQL)
$table->dropForeign(['producto_id']);
// Recrear la clave foránea con SET NULL
$table->foreign('producto_id')