UNPKG

@clickup/pg-mig

Version:

PostgreSQL schema migration tool with microsharding and clustering support

17 lines 684 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isSchemaValid = isSchemaValid; /** * Returns true if the schema should have migrations applied. Non-shard schemas * (matched by the exact prefix name, e.g. "public") are always valid. Shard * schemas (matched by prefix + digits, e.g. "sh0042") are valid only when * validShards is undefined (no filter) or contains the schema name. */ function isSchemaValid(schema, schemaPrefix, validShards) { if (!validShards) { return true; } const isShardSchema = schema !== schemaPrefix; return !isShardSchema || validShards.has(schema); } //# sourceMappingURL=isSchemaValid.js.map