feat(remove): implement the "remove" command for removing migrations from the history
This commit is contained in:
parent
9447d28ad8
commit
d8a6a2428a
12 changed files with 370 additions and 24 deletions
|
|
@ -18,16 +18,12 @@ import {
|
|||
import { type Config } from '../types.js';
|
||||
import { withLeadingPeriod } from '../with-leading-period.js';
|
||||
import { getMigrations } from '../get-migrations.js';
|
||||
import { getDuration } from '../get-duration.js';
|
||||
|
||||
type ExtraFlags = {
|
||||
dry?: boolean;
|
||||
};
|
||||
|
||||
const getDuration = (start: [number, number]) => {
|
||||
const [seconds, nanoseconds] = process.hrtime(start);
|
||||
return seconds * 1000 + nanoseconds / 1_000_000;
|
||||
};
|
||||
|
||||
const lazyDefaultReporter = async () => import('../reporters/default.js');
|
||||
const lazyPluginLoaderJs = async () => import('../plugin-loader-js.js');
|
||||
|
||||
|
|
@ -81,7 +77,7 @@ export default async function upCommand({
|
|||
relativeFilePath: path.relative(cwd, filePath),
|
||||
extension: withLeadingPeriod(path.extname(migrationHistoryEntry.name)),
|
||||
error: new MigrationHistoryError(
|
||||
`Migration ${migrationHistoryEntry.name} is in a failed state, please fix it first`,
|
||||
`Migration ${migrationHistoryEntry.name} is in a failed state, please fix and remove it first`,
|
||||
migrationHistoryEntry,
|
||||
),
|
||||
directory,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue