@coko/server
Version:
Reusable server for use by Coko's projects
32 lines • 1.17 kB
TypeScript
import { Umzug, MigrationFn, MigrateUpOptions, MigrateDownOptions, MigrationMeta } from 'umzug';
type Migration = {
name: string;
path: string;
up: MigrationFn;
down?: MigrationFn;
};
export default class MigrationRunner {
pattern: string;
threshold: number;
umzug: Umzug;
constructor(components?: string[]);
static stripMigrationExtensionName(filename: string): string;
/**
* The threshold represents from which point in time forward the rules will
* apply (the creation of the meta table, ie. from the moment they upgraded to
* coko server v4).
*/
static findThreshold(): Promise<number>;
/**
* After installing v4, some rules will apply for migrations, but only for new
* migrations, so that developers don't have to rewrite all existing migrations.
*/
parseMigration(filePath: string): Promise<Migration>;
init(): Promise<void>;
up(options: MigrateUpOptions): Promise<void>;
down(options: MigrateDownOptions): Promise<void>;
pending(): Promise<MigrationMeta[]>;
executed(): Promise<MigrationMeta[]>;
}
export {};
//# sourceMappingURL=migrationRunner.d.ts.map