orchid-orm 1.25.2 → 1.25.3
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 +6 -6
- package/dist/migrations.js.map +1 -1
- package/dist/migrations.mjs +6 -6
- package/dist/migrations.mjs.map +1 -1
- package/package.json +3 -3
package/dist/migrations.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var rakeDb = require('rake-db');
|
|
4
4
|
var pqb = require('pqb');
|
|
5
5
|
var orchidCore = require('orchid-core');
|
|
6
|
-
var fs = require('fs/promises');
|
|
7
6
|
var path = require('node:path');
|
|
7
|
+
var fs = require('fs/promises');
|
|
8
8
|
var typescript = require('typescript');
|
|
9
9
|
|
|
10
10
|
const compareSqlExpressions = async (tableExpressions, adapter) => {
|
|
@@ -2239,7 +2239,7 @@ const invalidConfig = (config) => new Error(
|
|
|
2239
2239
|
);
|
|
2240
2240
|
const getDbFromConfig = async (config, dbPath) => {
|
|
2241
2241
|
var _a, _b;
|
|
2242
|
-
const module = await config.import(dbPath);
|
|
2242
|
+
const module = await config.import(path.resolve(config.basePath, dbPath));
|
|
2243
2243
|
const db = module[(_a = config.dbExportedAs) != null ? _a : "db"];
|
|
2244
2244
|
if (!(db == null ? void 0 : db.$queryBuilder)) {
|
|
2245
2245
|
throw new Error(
|
|
@@ -2283,7 +2283,7 @@ const migrateAndPullStructures = async (options, config, afterPull) => {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
return { dbStructure, adapters };
|
|
2285
2285
|
};
|
|
2286
|
-
const compareDbStructures = (a, b, i,
|
|
2286
|
+
const compareDbStructures = (a, b, i, path2) => {
|
|
2287
2287
|
let err;
|
|
2288
2288
|
if (typeof a !== typeof b) {
|
|
2289
2289
|
err = true;
|
|
@@ -2299,7 +2299,7 @@ const compareDbStructures = (a, b, i, path) => {
|
|
|
2299
2299
|
a[n],
|
|
2300
2300
|
b[n],
|
|
2301
2301
|
i,
|
|
2302
|
-
|
|
2302
|
+
path2 ? `${path2}[${n}]` : String(n)
|
|
2303
2303
|
);
|
|
2304
2304
|
}
|
|
2305
2305
|
} else {
|
|
@@ -2308,13 +2308,13 @@ const compareDbStructures = (a, b, i, path) => {
|
|
|
2308
2308
|
a[key],
|
|
2309
2309
|
b[key],
|
|
2310
2310
|
i,
|
|
2311
|
-
|
|
2311
|
+
path2 ? `${path2}.${key}` : key
|
|
2312
2312
|
);
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
2316
|
if (err) {
|
|
2317
|
-
throw new Error(`${
|
|
2317
|
+
throw new Error(`${path2} in the db 0 does not match db ${i}`);
|
|
2318
2318
|
}
|
|
2319
2319
|
};
|
|
2320
2320
|
const getActualItems = async (db, currentSchema, internal, columnTypes) => {
|