up
This commit is contained in:
+2
-2
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user