import Database from "better-sqlite3"; /** Maximum migration version this codebase supports. */ export declare const MAX_VERSION = 9; /** * Thrown when a database was written by a NEWER version of CogMemory * (user_version > MAX_VERSION). Opening it with an older binary risks * corrupting state (missing columns/tables/constraints), so startup is * refused instead of silently skipping migrations. */ export declare class SchemaVersionError extends Error { constructor(dbVersion: number, supportedVersion: number); } /** * Run all pending migrations up to MAX_VERSION. * * - For user_version=0 DBs (pre-migration-system), creates a backup file. * - Each migration runs inside a single transaction (BEGIN…COMMIT). * - On failure: ROLLBACK, stderr error, throw to the caller. * - FTS rebuilds are inside 001_baseline.sql only (not on every open). */ export declare function runMigrations(db: Database.Database, dbPath: string): void; /** * Guard: check whether a column already exists on a table. * Useful for ALTER TABLE ADD COLUMN in raw SQL migrations. */ export declare function columnExists(db: Database.Database, table: string, column: string): boolean; //# sourceMappingURL=migration-runner.d.ts.map