refactor(cli): introduce the migration-runner helper for less code duplication and fewer return paths
Thanks to the migration-runner the "up" and "list" commands are now very similar code wise
This commit is contained in:
parent
5307e87242
commit
8cc43a8f83
9 changed files with 332 additions and 294 deletions
|
|
@ -156,7 +156,13 @@ export type MigrationMetadata = {
|
|||
export type MigrationMetadataFinished = MigrationMetadata & {
|
||||
status: MigrationStatus | 'skipped';
|
||||
duration: number;
|
||||
error?: SerializedError;
|
||||
error?: Error;
|
||||
};
|
||||
|
||||
export const isFinishedMigration = (
|
||||
migration: MigrationMetadata | MigrationMetadataFinished,
|
||||
): migration is MigrationMetadataFinished => {
|
||||
return 'status' in migration;
|
||||
};
|
||||
|
||||
export type LoaderPlugin = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue