orchid-orm 1.26.2 → 1.27.0
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.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/migrations.js +4 -3
- package/dist/migrations.js.map +1 -1
- package/dist/migrations.mjs +4 -3
- package/dist/migrations.mjs.map +1 -1
- package/package.json +5 -5
package/dist/migrations.js
CHANGED
|
@@ -1489,6 +1489,7 @@ const processTables = async (ast, structureToAstCtx, domainsMap, adapter, tables
|
|
|
1489
1489
|
const compareSql = { values: [], expressions: [] };
|
|
1490
1490
|
const tableExpressions = [];
|
|
1491
1491
|
const { changeTables, changeTableSchemas, dropTables, tableShapes } = collectChangeAndDropTables(
|
|
1492
|
+
config,
|
|
1492
1493
|
tables,
|
|
1493
1494
|
dbStructure,
|
|
1494
1495
|
currentSchema,
|
|
@@ -1542,13 +1543,13 @@ const collectCreateTables = (tables, dbStructure, currentSchema) => {
|
|
|
1542
1543
|
return acc;
|
|
1543
1544
|
}, []);
|
|
1544
1545
|
};
|
|
1545
|
-
const collectChangeAndDropTables = (tables, dbStructure, currentSchema, createTables) => {
|
|
1546
|
+
const collectChangeAndDropTables = (config, tables, dbStructure, currentSchema, createTables) => {
|
|
1546
1547
|
const changeTables = [];
|
|
1547
1548
|
const changeTableSchemas = [];
|
|
1548
1549
|
const dropTables = [];
|
|
1549
1550
|
const tableShapes = {};
|
|
1550
1551
|
for (const dbTable of dbStructure.tables) {
|
|
1551
|
-
if (dbTable.name ===
|
|
1552
|
+
if (dbTable.name === config.migrationsTable)
|
|
1552
1553
|
continue;
|
|
1553
1554
|
const codeTable = tables.find(
|
|
1554
1555
|
(t) => {
|
|
@@ -2759,7 +2760,7 @@ const pull = async (options, config) => {
|
|
|
2759
2760
|
const [adapter] = adapters;
|
|
2760
2761
|
const currentSchema = adapter.schema || "public";
|
|
2761
2762
|
const ctx = rakeDb.makeStructureToAstCtx(config, currentSchema);
|
|
2762
|
-
const asts = await rakeDb.structureToAst(ctx, adapter);
|
|
2763
|
+
const asts = await rakeDb.structureToAst(ctx, adapter, config);
|
|
2763
2764
|
const { tableInfos, fkeys } = getTableInfosAndFKeys(asts, config);
|
|
2764
2765
|
const exclusiveWriteOptions = { flag: "wx" };
|
|
2765
2766
|
const pendingFileWrites = [];
|