import type { IMastraLogger } from '@mastra/core/logger';
import type { DuckDBConnection } from '../../db/index.js';
export interface SignalMigrationStatusTable {
    table: string;
    idColumn: string;
}
export interface SignalMigrationStatus {
    needsMigration: boolean;
    tables: SignalMigrationStatusTable[];
}
/**
 * Drop any leftover `DEFAULT nextval(...)` on observability `cursorId` columns.
 *
 * A previous version of the migration set this default via
 * `ALTER COLUMN cursorId SET DEFAULT nextval(...)`. DuckDB WAL replay cannot
 * bind that function expression before the default database is attached, so
 * affected databases fail to reopen. Insert paths now write cursor IDs
 * explicitly, so the catalog default is unnecessary and should be removed.
 *
 * We query `information_schema` first and only emit the `ALTER` for tables that
 * actually carry the bad default; this avoids writing redundant SetDefault
 * entries to the WAL on every startup for healthy databases.
 */
export declare function dropLegacyCursorIdDefaults(db: DuckDBConnection): Promise<void>;
export declare function checkSignalTablesMigrationStatus(db: DuckDBConnection): Promise<SignalMigrationStatus>;
/**
 * Migrate signal tables to a schema with PRIMARY KEY + NOT NULL on the signal ID
 * without dropping data. Copy-and-swap: create temp → INSERT…SELECT
 * (generating IDs) → rename old to backup → rename temp to live → drop backup.
 * The live table is only touched during the final swap step.
 */
export declare function migrateSignalTables(db: DuckDBConnection, logger?: IMastraLogger): Promise<void>;
//# sourceMappingURL=migration.d.ts.map