import type { MigrationParams, RunnableMigration } from 'umzug'; import type { Constructor, IMigrator } from '@mikro-orm/core'; import type { EntityManager } from '@mikro-orm/knex'; import { DatabaseSchema } from '@mikro-orm/knex'; import type { Migration } from './Migration'; import { MigrationStorage } from './MigrationStorage'; import type { MigrateOptions, MigrationResult, MigrationRow, UmzugMigration } from './typings'; export declare class Migrator implements IMigrator { private readonly em; private umzug; private runner; private storage; private generator; private readonly driver; private readonly schemaGenerator; private readonly config; private readonly options; private readonly absolutePath; private readonly snapshotPath; constructor(em: EntityManager); /** * @inheritDoc */ createMigration(path?: string, blank?: boolean, initial?: boolean): Promise; /** * @inheritDoc */ createInitialMigration(path?: string): Promise; private createUmzug; /** * Initial migration can be created only if: * 1. no previous migrations were generated or executed * 2. existing schema do not contain any of the tables defined by metadata * * If existing schema contains all of the tables already, we return true, based on that we mark the migration as already executed. * If only some of the tables are present, exception is thrown. */ private validateInitialMigration; /** * @inheritDoc */ getExecutedMigrations(): Promise; private ensureDatabase; /** * @inheritDoc */ getPendingMigrations(): Promise; /** * @inheritDoc */ up(options?: string | string[] | MigrateOptions): Promise; /** * @inheritDoc */ down(options?: string | string[] | MigrateOptions): Promise; getStorage(): MigrationStorage; protected resolve(params: MigrationParams): RunnableMigration; protected getCurrentSchema(): Promise; protected storeCurrentSchema(): Promise; protected initialize(MigrationClass: Constructor, name: string): RunnableMigration; private getSchemaDiff; private getMigrationFilename; private prefix; private runMigrations; private runInTransaction; private ensureMigrationsDirExists; }