import { MultiDbManager, Dimension } from './multi-db-manager'; /** * Manages database schema migrations for all 5 dimensions. * Migrations are stored in the schemas/sqlite/ directory. */ export declare class MigrationManager { private dbManager; private migrationsDirectory; /** * Creates a new MigrationManager instance. * * @param dbManager The MultiDbManager instance * @param pluginRoot The root directory of the plugin (where schemas/ is located) */ constructor(dbManager: MultiDbManager, pluginRoot: string); /** * Checks if the migrations table has the correct structure (composite PRIMARY KEY). * * @param db The SQLite database instance * @returns Promise that resolves to true if structure is correct, false otherwise */ private checkMigrationsTableStructure; /** * Ensures the migrations table exists in a database with the correct structure. * If the table exists with the old structure (version only as PRIMARY KEY), * it will be dropped and recreated with the new structure. * * @param db The SQLite database instance * @returns Promise that resolves when the table is created/updated */ private ensureMigrationsTable; /** * Gets the list of applied migrations for a database. * * @param db The SQLite database instance * @returns Promise that resolves to an array of migration records */ private getAppliedMigrations; /** * Checks if a migration version already exists in the database. * * @param db The SQLite database instance * @param version The migration version number * @returns Promise that resolves to true if the migration exists, false otherwise */ /** * Checks if a specific migration (version + name) already exists in the database. * * @param db The SQLite database instance * @param version The migration version number * @param name The migration name * @returns Promise that resolves to true if the migration exists, false otherwise */ private checkMigrationExists; /** * Reads a migration file from disk. * * @param migrationFile The migration file name (e.g., "001_initial_modules.sql") * @returns The SQL content of the migration file */ private readMigrationFile; /** * Applies a migration to a database. * * @param db The SQLite database instance * @param version The migration version number * @param name The migration name * @param sql The SQL content to execute * @returns Promise that resolves when the migration is applied */ private applyMigration; /** * Gets all migration files for a dimension, sorted by version. * * @param dimension The dimension * @returns Array of migration file names */ private getMigrationFilesForDimension; /** * Gets the dimension prefix for migration files. * * @param dimension The dimension * @returns The prefix (e.g., "001" for X, "002" for Y, etc.) */ private getDimensionPrefix; /** * Gets the required tables for a dimension. * * @param dimension The dimension * @returns Array of required table names */ private getRequiredTables; /** * Checks if all required tables exist in the database. * * @param db The SQLite database instance * @param dimension The dimension to check * @returns Promise that resolves to true if all tables exist, false otherwise */ private checkTablesExist; /** * Runs all pending migrations for a dimension. * * @param dimension The dimension to migrate * @returns Promise that resolves when all migrations are applied */ migrate(dimension: Dimension): Promise; /** * Runs all pending migrations for all dimensions. * * @returns Promise that resolves when all migrations are applied */ migrateAll(): Promise; } //# sourceMappingURL=migration-manager.d.ts.map