orchid-orm 1.26.0 → 1.26.2
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 +4 -1
- package/dist/migrations.js.map +1 -1
- package/dist/migrations.mjs +4 -1
- package/dist/migrations.mjs.map +1 -1
- package/package.json +4 -4
package/dist/migrations.mjs
CHANGED
|
@@ -3,6 +3,7 @@ export * from 'rake-db';
|
|
|
3
3
|
import { EnumColumn, DomainColumn, RawSQL, ArrayColumn, VirtualColumn, UnknownColumn, defaultSchemaConfig, columnsShapeToCode, pushTableDataCode, Adapter } from 'pqb';
|
|
4
4
|
import { deepCompare, toArray, addCode, codeToString, toCamelCase, toPascalCase, getImportPath, singleQuote, quoteObjectKey, pathToLog } from 'orchid-core';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
+
import { pathToFileURL } from 'url';
|
|
6
7
|
import fs from 'fs/promises';
|
|
7
8
|
import typescript from 'typescript';
|
|
8
9
|
|
|
@@ -2234,7 +2235,9 @@ const invalidConfig = (config) => new Error(
|
|
|
2234
2235
|
);
|
|
2235
2236
|
const getDbFromConfig = async (config, dbPath) => {
|
|
2236
2237
|
var _a, _b;
|
|
2237
|
-
const module = await config.import(
|
|
2238
|
+
const module = await config.import(
|
|
2239
|
+
pathToFileURL(path.resolve(config.basePath, dbPath)).toString()
|
|
2240
|
+
);
|
|
2238
2241
|
const db = module[(_a = config.dbExportedAs) != null ? _a : "db"];
|
|
2239
2242
|
if (!(db == null ? void 0 : db.$queryBuilder)) {
|
|
2240
2243
|
throw new Error(
|