/** The current installed schema version this build knows how to reach. */ export declare const INITIATIVE_SCHEMA_VERSION = 8; export interface RunInitiativeMigrationsOptions { /** Absolute path to `initiatives.db`. Never `executions.db`. */ dbPath: string; /** * Test seam: replaces the default backup copy (`fs.copyFileSync`). Production * never supplies this. Throwing here (or leaving no readable file at the * destination) fails the migration with `migration_backup_failed`. */ copyBackup?: (sourcePath: string, destinationPath: string) => void; } export interface RunInitiativeMigrationsResult { /** Set only when an existing database file was backed up before upgrade; `null` on first creation. */ backup_path: string | null; /** The installed schema version (`PRAGMA user_version`) after this call. */ schema_version: number; } /** * Creates or upgrades `/initiatives.db` to {@link INITIATIVE_SCHEMA_VERSION}. * * First creation (no prior file at `dbPath`) never backs up — there is nothing * to protect. An existing file is backed up ONLY when at least one migration is * pending (an up-to-date database opens with no backup, so routine opens do not * grow the state directory). Before the copy, the WAL is checkpointed * (`PRAGMA wal_checkpoint(TRUNCATE)`) so committed data still sitting in the * `-wal` sidecar after an unclean shutdown is folded into the main file the * backup copies. The backup is then verified (exists, exact pre-change byte * length) before any schema change. A backup failure throws * {@link MigrationBackupFailedError} before any schema change — the original * database is left untouched and no partial upgrade can occur. */ export declare function runInitiativeMigrations(opts: RunInitiativeMigrationsOptions): RunInitiativeMigrationsResult; //# sourceMappingURL=migrations.d.ts.map