UNPKG

@accounter/server

Version:
19 lines (18 loc) 814 B
import { type Client, Pool, type PoolClient } from 'pg'; import { LATEST_MIGRATION_NAME } from '../../../../migrations/src/run-pg-migrations.js'; export { LATEST_MIGRATION_NAME }; interface MigrationCheckResult { isLatest: boolean; latestMigrationName: string | undefined; errorMessage?: string; } /** * Check if the latest migration has been applied to the database. * Returns result object with status - does not throw. */ export declare function checkLatestMigration(clientOrPool: Pool | PoolClient | Client, schema?: string): Promise<MigrationCheckResult>; /** * Assert that the latest migration has been applied. * Throws an error with helpful message if not. */ export declare function assertLatestMigrationApplied(clientOrPool: Pool | PoolClient | Client, schema?: string): Promise<void>;