rake-db 2.10.31 → 2.10.32
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.d.ts +19 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1015,8 +1015,27 @@ type ChangeCallback<CT extends ColumnTypesBase = ColumnTypesBase> = (db: DbMigra
|
|
|
1015
1015
|
|
|
1016
1016
|
declare const migrateOrRollback: <CT extends Record<string, orchid_core.AnyColumnTypeCreator>>(options: MaybeArray<AdapterOptions>, config: RakeDbConfig<CT>, args: string[], up: boolean) => Promise<void>;
|
|
1017
1017
|
declare const changeCache: Record<string, ChangeCallback[] | undefined>;
|
|
1018
|
+
/**
|
|
1019
|
+
* Will run all pending yet migrations, sequentially in order,
|
|
1020
|
+
* will apply `change` functions top-to-bottom.
|
|
1021
|
+
*
|
|
1022
|
+
* @param options - options to construct db adapter with
|
|
1023
|
+
* @param config - specifies how to load migrations, may have `appCodeUpdater`, callbacks, and logger.
|
|
1024
|
+
* @param args - pass none or `all` to run all migrations, pass int for how many to migrate, `--code` to enable and `--code false` to disable `useCodeUpdater`.
|
|
1025
|
+
*/
|
|
1018
1026
|
declare const migrate: <CT extends Record<string, orchid_core.AnyColumnTypeCreator>>(options: MaybeArray<AdapterOptions>, config: RakeDbConfig<CT>, args?: string[]) => Promise<void>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Will roll back one latest applied migration,
|
|
1029
|
+
* will apply `change` functions bottom-to-top.
|
|
1030
|
+
*
|
|
1031
|
+
* Takes the same options as {@link migrate}.
|
|
1032
|
+
*/
|
|
1019
1033
|
declare const rollback: <CT extends Record<string, orchid_core.AnyColumnTypeCreator>>(options: MaybeArray<AdapterOptions>, config: RakeDbConfig<CT>, args?: string[]) => Promise<void>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Calls {@link rollback} and then {@link migrate}.
|
|
1036
|
+
*
|
|
1037
|
+
* Takes the same options as {@link migrate}.
|
|
1038
|
+
*/
|
|
1020
1039
|
declare const redo: <CT extends Record<string, orchid_core.AnyColumnTypeCreator>>(options: MaybeArray<AdapterOptions>, config: RakeDbConfig<CT>, args?: string[]) => Promise<void>;
|
|
1021
1040
|
|
|
1022
1041
|
declare const rakeDb: <CT extends Record<string, orchid_core.AnyColumnTypeCreator> = {
|
package/dist/index.js
CHANGED
|
@@ -2311,7 +2311,11 @@ const processMigration = async (db, up, file, config, options, appCodeUpdaterCac
|
|
|
2311
2311
|
const migrate = (options, config, args = []) => migrateOrRollback(options, config, args, true);
|
|
2312
2312
|
const rollback = (options, config, args = []) => migrateOrRollback(options, config, args, false);
|
|
2313
2313
|
const redo = async (options, config, args = []) => {
|
|
2314
|
+
var _a;
|
|
2314
2315
|
await migrateOrRollback(options, config, args, false);
|
|
2316
|
+
for (const file in changeCache) {
|
|
2317
|
+
(_a = changeCache[file]) == null ? void 0 : _a.reverse();
|
|
2318
|
+
}
|
|
2315
2319
|
await migrateOrRollback(options, config, args, true);
|
|
2316
2320
|
};
|
|
2317
2321
|
|