UNPKG

couchbase-index-manager

Version:
27 lines 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MoveIndexMutation = void 0; const tslib_1 = require("tslib"); const chalk_1 = (0, tslib_1.__importDefault)(require("chalk")); const index_mutation_1 = require("./index-mutation"); /** * Represents an index mutation which updates an existing index */ class MoveIndexMutation extends index_mutation_1.IndexMutation { constructor(definition, name) { super(definition, name); if (!definition.nodes) { throw new Error('Missing nodes on IndexDefinition'); } this.nodes = definition.nodes; } print(logger) { logger.info(chalk_1.default.cyanBright(` Move: ${this.displayName}`)); logger.info(chalk_1.default.cyanBright(` Nodes: ${this.nodes.join()}`)); } async execute(manager) { await manager.moveIndex(this.name, this.scope, this.collection, this.nodes); } } exports.MoveIndexMutation = MoveIndexMutation; //# sourceMappingURL=move-index-mutation.js.map