rake-db 2.4.17 → 2.4.18
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/index.js +21 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -2462,17 +2462,27 @@ const pushTableAst = (ctx, ast, data, domains, table, pendingTables, innerFKeys
|
|
|
2462
2462
|
}
|
|
2463
2463
|
}
|
|
2464
2464
|
};
|
|
2465
|
-
const foreignKeyToAst = (fkey) =>
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2465
|
+
const foreignKeyToAst = (fkey) => {
|
|
2466
|
+
const result = {
|
|
2467
|
+
columns: fkey.columnNames,
|
|
2468
|
+
fnOrTable: fkey.foreignTableName,
|
|
2469
|
+
foreignColumns: fkey.foreignColumnNames,
|
|
2470
|
+
options: {}
|
|
2471
|
+
};
|
|
2472
|
+
if (fkey.name && fkey.name !== getForeignKeyName(fkey.tableName, fkey.columnNames)) {
|
|
2473
|
+
result.options.name = fkey.name;
|
|
2474
|
+
}
|
|
2475
|
+
const match = matchMap[fkey.match];
|
|
2476
|
+
if (match)
|
|
2477
|
+
result.options.match = match;
|
|
2478
|
+
const onUpdate = fkeyActionMap[fkey.onUpdate];
|
|
2479
|
+
if (onUpdate)
|
|
2480
|
+
result.options.onUpdate = onUpdate;
|
|
2481
|
+
const onDelete = fkeyActionMap[fkey.onDelete];
|
|
2482
|
+
if (onDelete)
|
|
2483
|
+
result.options.onDelete = onDelete;
|
|
2484
|
+
return result;
|
|
2485
|
+
};
|
|
2476
2486
|
|
|
2477
2487
|
const astToMigration = (config, ast) => {
|
|
2478
2488
|
const first = [];
|