rake-db 2.3.5 → 2.3.6
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/CHANGELOG.md +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/commands/migrateOrRollback.ts +1 -1
- package/src/common.ts +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -185,7 +185,7 @@ declare namespace RakeDbAst {
|
|
|
185
185
|
declare type RakeDbConfig = {
|
|
186
186
|
migrationsPath: string;
|
|
187
187
|
migrationsTable: string;
|
|
188
|
-
requireTs(path: string): void
|
|
188
|
+
requireTs(path: string): Promise<void>;
|
|
189
189
|
noPrimaryKey?: NoPrimaryKeyOption;
|
|
190
190
|
appCodeUpdater?: AppCodeUpdater;
|
|
191
191
|
useCodeUpdater?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,24 @@ var promises = require('fs/promises');
|
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n["default"] = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
12
30
|
var Enquirer__default = /*#__PURE__*/_interopDefaultLegacy(Enquirer);
|
|
13
31
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
14
32
|
|
|
@@ -34,7 +52,7 @@ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
|
34
52
|
const migrationConfigDefaults = {
|
|
35
53
|
migrationsPath: path__default["default"].resolve("src", "migrations"),
|
|
36
54
|
migrationsTable: "schemaMigrations",
|
|
37
|
-
requireTs: require,
|
|
55
|
+
requireTs: (path2) => (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(path2),
|
|
38
56
|
log: true,
|
|
39
57
|
logger: console,
|
|
40
58
|
useCodeUpdater: true
|
|
@@ -1156,7 +1174,7 @@ const processMigration = async (db, up, file, config, options, appCodeUpdaterCac
|
|
|
1156
1174
|
if (callback) {
|
|
1157
1175
|
change(callback);
|
|
1158
1176
|
} else {
|
|
1159
|
-
config.requireTs(file.path);
|
|
1177
|
+
await config.requireTs(file.path);
|
|
1160
1178
|
changeCache[file.path] = getCurrentChangeCallback();
|
|
1161
1179
|
}
|
|
1162
1180
|
await getCurrentPromise();
|