/** * PostgreSQL Migration Tools — Shared Helpers * * Constants, SQL builders, and utilities used by migration tool factories. */ import type { PostgresAdapter } from "../../postgres-adapter.js"; export declare const TRACKING_TABLE = "_mcp_schema_versions"; /** * Build the CREATE TABLE DDL for the tracking table. * Accepts a pre-computed qualified table name (e.g. `_mcp_schema_versions` * or `"custom_schema"."_mcp_schema_versions"`) so the caller controls * schema qualification without fragile string replacement. */ export declare function buildCreateTrackingTableSql(qualifiedTable: string): string; /** * Ensure the _mcp_schema_versions table exists in the public schema. * Returns true if the table was newly created, false if it already existed. */ export declare function ensureTrackingTable(adapter: PostgresAdapter, targetSchema?: string): Promise; export declare function hashMigrationSql(sql: string): string; /** * Check for an already-applied migration with the same SQL hash. * Returns an error result object if duplicate found, or null if clear. */ export declare function checkDuplicateHash(adapter: PostgresAdapter, migrationSql: string, qualifiedTable?: string): Promise<{ migrationHash: string; duplicateError: null | { success: false; error: string; code: string; category: string; recoverable: boolean; }; }>; export interface FormattedRecord { id: number; version: string; description: string | null; appliedAt: string; appliedBy: string | null; migrationHash: string; sourceSystem: string | null; status: string; errorInformation?: string | null; } export declare function formatRecord(row: Record): FormattedRecord; //# sourceMappingURL=helpers.d.ts.map