import { type IMigrationGenerator, type IMigrationRunner, type IMigratorStorage, type MigrateOptions, type MigrationInfo, type MikroORM, } from '@mikro-orm/core'; import { AbstractMigrator } from '@mikro-orm/core/migrations'; import { type AbstractSqlDriver, DatabaseSchema, type EntityManager } from '@mikro-orm/sql'; import { MigrationStorage } from './MigrationStorage.js'; import type { MigrationResult } from './typings.js'; /** Manages SQL database migrations: creation, execution, and rollback of schema changes. */ export declare class Migrator extends AbstractMigrator { #private; constructor(em: EntityManager); static register(orm: MikroORM): void; protected createRunner(): IMigrationRunner; protected createStorage(): IMigratorStorage; protected getDefaultGenerator(): IMigrationGenerator; private getSnapshotPath; protected init(): Promise; /** * @inheritDoc */ create(path?: string, blank?: boolean, initial?: boolean, name?: string): Promise; getPending(): Promise; private hasSnapshot; checkSchema(): Promise; /** * @inheritDoc */ createInitial(path?: string, name?: string, blank?: boolean): Promise; protected runMigrations( method: 'up' | 'down', options?: string | string[] | MigrateOptions, ): Promise; getStorage(): MigrationStorage; /** * 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; protected getSchemaFromSnapshot(): Promise; protected storeCurrentSchema(schema?: DatabaseSchema): Promise; private getSchemaDiff; }