orchid-orm 1.34.2 → 1.34.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/migrations.js +7 -4
- package/dist/migrations.js.map +1 -1
- package/dist/migrations.mjs +7 -4
- package/dist/migrations.mjs.map +1 -1
- package/package.json +4 -4
package/dist/migrations.js
CHANGED
|
@@ -106,7 +106,9 @@ const checkForColumnAddOrDrop = (shape, key) => {
|
|
|
106
106
|
}
|
|
107
107
|
for (const k in shape) {
|
|
108
108
|
const item2 = shape[k];
|
|
109
|
-
if (Array.isArray(item2)
|
|
109
|
+
if (Array.isArray(item2) ? item2.some(
|
|
110
|
+
(item3) => (item3.type === "add" || item3.type === "drop") && item3.item.data.name === key
|
|
111
|
+
) : (item2.type === "add" || item2.type === "drop") && item2.item.data.name === key) {
|
|
110
112
|
return true;
|
|
111
113
|
}
|
|
112
114
|
}
|
|
@@ -1457,9 +1459,10 @@ const processForeignKeys = (config, ast, changeTables, currentSchema, tableShape
|
|
|
1457
1459
|
if (hasChangedColumn)
|
|
1458
1460
|
continue;
|
|
1459
1461
|
const foreignShape = tableShapes[`${dbReferences.foreignSchema}.${dbReferences.foreignTable}`];
|
|
1460
|
-
const hasForeignChangedColumn = foreignShape && dbReferences.foreignColumns.some(
|
|
1461
|
-
|
|
1462
|
-
|
|
1462
|
+
const hasForeignChangedColumn = foreignShape && dbReferences.foreignColumns.some((column) => {
|
|
1463
|
+
const res = checkForColumnAddOrDrop(foreignShape, column);
|
|
1464
|
+
return res;
|
|
1465
|
+
});
|
|
1463
1466
|
if (hasForeignChangedColumn)
|
|
1464
1467
|
continue;
|
|
1465
1468
|
let found = false;
|