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.
@@ -105,7 +105,9 @@ const checkForColumnAddOrDrop = (shape, key) => {
105
105
  }
106
106
  for (const k in shape) {
107
107
  const item2 = shape[k];
108
- if (Array.isArray(item2) || item2.type === "add" || item2.type === "drop") {
108
+ if (Array.isArray(item2) ? item2.some(
109
+ (item3) => (item3.type === "add" || item3.type === "drop") && item3.item.data.name === key
110
+ ) : (item2.type === "add" || item2.type === "drop") && item2.item.data.name === key) {
109
111
  return true;
110
112
  }
111
113
  }
@@ -1456,9 +1458,10 @@ const processForeignKeys = (config, ast, changeTables, currentSchema, tableShape
1456
1458
  if (hasChangedColumn)
1457
1459
  continue;
1458
1460
  const foreignShape = tableShapes[`${dbReferences.foreignSchema}.${dbReferences.foreignTable}`];
1459
- const hasForeignChangedColumn = foreignShape && dbReferences.foreignColumns.some(
1460
- (column) => checkForColumnAddOrDrop(foreignShape, column)
1461
- );
1461
+ const hasForeignChangedColumn = foreignShape && dbReferences.foreignColumns.some((column) => {
1462
+ const res = checkForColumnAddOrDrop(foreignShape, column);
1463
+ return res;
1464
+ });
1462
1465
  if (hasForeignChangedColumn)
1463
1466
  continue;
1464
1467
  let found = false;