/** * Migration runner for Signet's SQLite database * * Reads the current schema version from `schema_migrations`, runs * any pending migrations in order (each inside a transaction), and * records execution in `schema_migrations_audit`. */ export interface MigrationDb { exec(sql: string): void; prepare(sql: string): { run(...args: unknown[]): void; get(...args: unknown[]): Record | undefined; all(...args: unknown[]): Record[]; }; } export interface MigrationArtifacts { readonly tables?: readonly string[]; readonly columns?: readonly { readonly table: string; readonly column: string; /** Skip verification when the table itself doesn't exist (conditional/repair migrations). */ readonly optional?: boolean; }[]; } export interface Migration { readonly version: number; readonly name: string; readonly up: (db: MigrationDb) => void; readonly artifacts?: MigrationArtifacts; } /** Ordered list of all migrations. New migrations go at the end. */ export declare const MIGRATIONS: readonly Migration[]; /** * Check whether there are unapplied migrations without running them. * Useful for backup-before-migrate logic in the daemon. * * Fully read-only: uses hasBogusVersion and findPhantomVersions for * detection only — no deletes. All repairs run exclusively inside * runMigrations so the daemon's backup version label stays accurate. */ export declare function hasPendingMigrations(db: MigrationDb): boolean; /** The highest migration version defined. */ export declare const LATEST_SCHEMA_VERSION: number; /** * Run all pending migrations against `db`. * * Idempotent — safe to call on every startup. Migrations that have * already been applied (tracked in `schema_migrations`) are skipped. * Set-based skip logic handles gaps from phantom repair correctly. * Each migration runs inside a SAVEPOINT so a failure rolls back * only that migration. */ export declare function runMigrations(db: MigrationDb): void; //# sourceMappingURL=index.d.ts.map