export interface MigrationOptions { /** Limit migration to specific table names. */ tables?: string[]; /** Populate secondary indexes for rows at old schema versions (default: true). */ populateSecondaries?: boolean; /** Convert old primary indices when primary key fields changed (default: true). */ migratePrimaries?: boolean; /** Rewrite all row data to the latest schema version (default: false). */ rewriteData?: boolean; /** Delete orphaned secondary/unique index entries (default: true). */ removeOrphans?: boolean; /** Progress callback. */ onProgress?: (info: ProgressInfo) => void; } export interface ProgressInfo { phase: string; processed: number; total?: number; table?: string; } export interface MigrationResult { /** Per-table counts of secondary index entries populated. */ secondaries: Record; /** Per-table counts of old primary rows migrated. */ primaries: Record; /** Per-table conversion failure counts by reason. */ conversionFailures: Record>; /** Per-table counts of rows rewritten to latest version. */ rewritten: Record; /** Number of orphaned index entries deleted. */ orphans: number; } /** * Run database migration: populate secondary indexes for old-version rows, * convert old primary indices, rewrite row data, and clean up orphaned indices. */ export declare function runMigration(options?: MigrationOptions): Promise;