orchid-orm 1.35.11 → 1.35.12
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 +15 -6
- package/dist/migrations.js.map +1 -1
- package/dist/migrations.mjs +15 -6
- package/dist/migrations.mjs.map +1 -1
- package/package.json +3 -3
package/dist/migrations.js
CHANGED
|
@@ -1787,7 +1787,7 @@ var __spreadValues$2 = (a, b) => {
|
|
|
1787
1787
|
return a;
|
|
1788
1788
|
};
|
|
1789
1789
|
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
1790
|
-
const processTables = async (ast, structureToAstCtx, domainsMap, adapter, tables, dbStructure, currentSchema, config, verifying) => {
|
|
1790
|
+
const processTables = async (ast, structureToAstCtx, domainsMap, adapter, tables, dbStructure, currentSchema, config, generatorIgnore, verifying) => {
|
|
1791
1791
|
const createTables = collectCreateTables(
|
|
1792
1792
|
tables,
|
|
1793
1793
|
dbStructure,
|
|
@@ -1800,7 +1800,8 @@ const processTables = async (ast, structureToAstCtx, domainsMap, adapter, tables
|
|
|
1800
1800
|
tables,
|
|
1801
1801
|
dbStructure,
|
|
1802
1802
|
currentSchema,
|
|
1803
|
-
createTables
|
|
1803
|
+
createTables,
|
|
1804
|
+
generatorIgnore
|
|
1804
1805
|
);
|
|
1805
1806
|
applyChangeTableSchemas(changeTableSchemas, currentSchema, ast);
|
|
1806
1807
|
await applyCreateOrRenameTables(
|
|
@@ -1850,18 +1851,25 @@ const collectCreateTables = (tables, dbStructure, currentSchema) => {
|
|
|
1850
1851
|
return acc;
|
|
1851
1852
|
}, []);
|
|
1852
1853
|
};
|
|
1853
|
-
const collectChangeAndDropTables = (config, tables, dbStructure, currentSchema, createTables) => {
|
|
1854
|
+
const collectChangeAndDropTables = (config, tables, dbStructure, currentSchema, createTables, generatorIgnore) => {
|
|
1855
|
+
var _a;
|
|
1854
1856
|
const changeTables = [];
|
|
1855
1857
|
const changeTableSchemas = [];
|
|
1856
1858
|
const dropTables = [];
|
|
1857
1859
|
const tableShapes = {};
|
|
1860
|
+
const ignoreTables = (_a = generatorIgnore == null ? void 0 : generatorIgnore.tables) == null ? void 0 : _a.map((name) => {
|
|
1861
|
+
const [schema = currentSchema, table] = rakeDb.getSchemaAndTableFromName(name);
|
|
1862
|
+
return { schema, table };
|
|
1863
|
+
});
|
|
1858
1864
|
for (const dbTable of dbStructure.tables) {
|
|
1859
|
-
if (dbTable.name === config.migrationsTable
|
|
1865
|
+
if (dbTable.name === config.migrationsTable || (ignoreTables == null ? void 0 : ignoreTables.some(
|
|
1866
|
+
({ schema, table }) => table === dbTable.name && schema === dbTable.schemaName
|
|
1867
|
+
)))
|
|
1860
1868
|
continue;
|
|
1861
1869
|
const codeTable = tables.find(
|
|
1862
1870
|
(t) => {
|
|
1863
|
-
var
|
|
1864
|
-
return t.table === dbTable.name && ((
|
|
1871
|
+
var _a2;
|
|
1872
|
+
return t.table === dbTable.name && ((_a2 = t.q.schema) != null ? _a2 : currentSchema) === dbTable.schemaName;
|
|
1865
1873
|
}
|
|
1866
1874
|
);
|
|
1867
1875
|
if (codeTable) {
|
|
@@ -2091,6 +2099,7 @@ const composeMigration = async (adapter, config, ast, dbStructure, {
|
|
|
2091
2099
|
dbStructure,
|
|
2092
2100
|
currentSchema,
|
|
2093
2101
|
config,
|
|
2102
|
+
internal.generatorIgnore,
|
|
2094
2103
|
verifying
|
|
2095
2104
|
);
|
|
2096
2105
|
return rakeDb.astToMigration(currentSchema, config, ast);
|