import { type DbExec } from "./client.js"; /** * Widen pre-existing 32-bit `integer` columns to 64-bit `BIGINT` in place on * Postgres. * * Several stores historically created millisecond-timestamp columns (e.g. * `agent_runs.started_at`, `application_state.updated_at`) as a literal * `INTEGER`. On Postgres that is int4 (max 2,147,483,647), so a millisecond * epoch such as 1782269273204 overflows with: * `value "1782269273204" is out of range for type integer` * The CREATE TABLE source was later switched to `BIGINT`, * but `CREATE TABLE IF NOT EXISTS` cannot re-type a column that already * exists, so long-lived databases keep the int4 column and every write * into it fails. Migrations now use `BIGINT` directly; this helper covers * tables created by older raw `ensureTable()` definitions. * * This widens such columns once, then no-ops: it only ALTERs columns whose * current type is `integer`, so already-bigint tables are never rewritten. * Widening int4 → int8 is additive and non-destructive (no data loss, no * narrowing), so it is safe to run unconditionally on every boot. * * Call from a store's `ensureTable()` right after its `CREATE TABLE IF NOT * EXISTS`, passing the millisecond-timestamp columns for that table. Pass the * UNQUALIFIED table name (the lookup is scoped to the `public` schema); the * `ALTER` resolves the table through the search path. */ export declare function widenIntColumnsToBigInt(table: string, columns: string[], injectedClient?: DbExec): Promise;