@clickup/pg-mig
Version:
PostgreSQL schema migration tool with microsharding and clustering support
42 lines • 1.19 kB
TypeScript
import type { Dest } from "./Dest";
import type { File, Registry } from "./Registry";
interface Mode {
undo: string | undefined;
/** SQL query returning the list of valid shard schemas. When provided, shard
* schemas (those matched by prefix+digits, not by exact name) absent from the
* result are skipped. Non-shard schemas like "public" are unaffected. */
validShardSchemasSql: string | undefined;
}
/**
* A migration to apply to some Dest.
*/
export interface Migration {
version: string;
file: File;
newVersions: string[] | null;
}
/**
* A sequence of migrations to apply one by one and ASAP to a
* particular Dest (i.e. on a particular schema or shard).
*/
export interface Chain {
type: "up" | "dn";
dest: Dest;
migrations: Migration[];
}
/**
* A set of chains to apply to the database.
*/
export declare class Patch {
private hosts;
private registry;
private mode;
constructor(hosts: Dest[], registry: Registry, mode: Mode);
getChains(): Promise<Chain[]>;
private getHostChains;
private getSchemaChain;
private getChainUp;
private getChainDn;
}
export {};
//# sourceMappingURL=Patch.d.ts.map