UNPKG

@clickup/pg-microsharding

Version:
14 lines 638 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resultAbort = resultAbort; const cleanUpPubSub_1 = require("./cleanUpPubSub"); const quote_1 = require("./quote"); const runSql_1 = require("./runSql"); /** * Cleans up after the shard migration on failure. */ async function resultAbort({ fromDsn, toDsn, schema, }) { await (0, cleanUpPubSub_1.cleanUpPubSub)({ fromDsn, toDsn, schema }); await (0, runSql_1.runSql)(toDsn, (0, quote_1.sql) `DROP schema IF EXISTS ${(0, quote_1.ident)(schema)} CASCADE`, "Dropping destination semi-migrated microshard"); } //# sourceMappingURL=resultAbort.js.map