/**
 * Migration status information
 */
export interface MigrationStatus {
    /** Whether there are pending migrations */
    hasPending: boolean;
    /** Number of pending migrations */
    pendingCount: number;
    /** Names of pending migrations */
    pendingMigrations: string[];
    /** Name of last applied migration, null if none */
    lastApplied: string | null;
    /** Current schema version (from drizzle migrations table) */
    schemaVersion: string;
    /** All applied migrations */
    appliedMigrations: string[];
}
/**
 * Schema validation result
 */
export interface SchemaValidationResult {
    /** Whether the schema is valid */
    valid: boolean;
    /** List of validation errors */
    errors: string[];
    /** List of warnings (non-critical issues) */
    warnings: string[];
}
/**
 * Schema drift detection result
 */
export interface SchemaDriftResult {
    /** Whether drift was detected */
    hasDrift: boolean;
    /** Whether drift is critical (blocks startup) */
    criticalDrift: boolean;
    /** Drift details */
    drifts: SchemaDrift[];
}
/**
 * Individual schema drift
 */
export interface SchemaDrift {
    /** Type of drift */
    type: 'missing_table' | 'missing_column' | 'type_mismatch' | 'missing_index' | 'extra_table' | 'extra_column';
    /** Schema object name */
    object: string;
    /** Expected value (from Drizzle schema) */
    expected?: string;
    /** Actual value (from database) */
    actual?: string;
    /** Whether this drift is critical */
    critical: boolean;
    /** Human-readable description */
    description: string;
}
/**
 * Migration run result
 */
export interface MigrationRunResult {
    /** Whether migrations ran successfully */
    success: boolean;
    /** Number of migrations applied */
    appliedCount: number;
    /** Names of applied migrations */
    appliedMigrations: string[];
    /** Error message if failed */
    error?: string;
}
/**
 * Migration rollback result
 */
export interface MigrationRollbackResult {
    /** Whether rollback was successful */
    success: boolean;
    /** Migration that was rolled back */
    rolledBack: string | null;
    /** Error message if failed */
    error?: string;
}
/**
 * Check migration status
 *
 * @returns Migration status information
 */
export declare function checkMigrations(): Promise<MigrationStatus>;
/**
 * Run all pending migrations
 *
 * @returns Migration run result
 */
export declare function runPendingMigrations(): Promise<MigrationRunResult>;
/**
 * Rollback the last applied migration
 *
 * NOTE: Drizzle ORM does not support automatic rollback.
 * This function attempts to find and execute a corresponding down migration file.
 *
 * @returns Rollback result
 */
export declare function rollbackLastMigration(): Promise<MigrationRollbackResult>;
/**
 * Validate the database schema against expected structure
 *
 * @returns Validation result
 */
export declare function validateSchema(): Promise<SchemaValidationResult>;
/**
 * Detect schema drift between database and expected schema
 *
 * @returns Schema drift detection result
 */
export declare function detectSchemaDrift(): Promise<SchemaDriftResult>;
/**
 * Error thrown when migrations are pending and auto-migrate is disabled
 */
export declare class PendingMigrationsError extends Error {
    readonly pendingMigrations: string[];
    readonly pendingCount: number;
    constructor(status: MigrationStatus);
}
/**
 * Error thrown when critical schema drift is detected
 */
export declare class CriticalSchemaDriftError extends Error {
    readonly drifts: SchemaDrift[];
    constructor(drifts: SchemaDrift[]);
}
/**
 * Options for startup migration check
 */
export interface StartupMigrationOptions {
    /** Whether to automatically run migrations */
    autoMigrate?: boolean;
    /** Whether to validate schema after migrations */
    validateAfterMigrate?: boolean;
    /** Whether to check for schema drift */
    checkDrift?: boolean;
    /** Whether to block on critical drift */
    blockOnCriticalDrift?: boolean;
}
/**
 * Check and optionally run migrations during startup
 *
 * @param options - Startup options
 * @throws PendingMigrationsError if migrations are pending and auto-migrate is disabled
 * @throws CriticalSchemaDriftError if critical drift is detected and blocking is enabled
 */
export declare function checkAndRunMigrations(options?: StartupMigrationOptions): Promise<{
    migrationStatus: MigrationStatus;
    validationResult?: SchemaValidationResult;
    driftResult?: SchemaDriftResult;
    migrationsRun: boolean;
}>;
/**
 * Get migration status for health check endpoint
 */
export declare function getMigrationStatusForHealth(): Promise<{
    healthy: boolean;
    status: 'ok' | 'pending_migrations' | 'error';
    details: {
        schemaVersion: string;
        pendingCount: number;
        lastApplied: string | null;
        autoMigrateEnabled: boolean;
    };
    error?: string;
}>;
//# sourceMappingURL=migration-checker.d.ts.map