UNPKG

morpheus4j

Version:

Morpheus is a migration tool for Neo4j. It aims to be a simple and intuitive way to migrate your database.

28 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CleanService = void 0; const logger_1 = require("./logger"); class CleanService { repository; constructor(repository) { this.repository = repository; } async clean(dropConstraints = false) { try { if (dropConstraints) { // Drop constraints first if requested await this.repository.cleanConstraints(); logger_1.Logger.info('Successfully dropped Moprheus constraints and indices'); } await this.repository.cleanMigrations(); logger_1.Logger.info('Successfully dropped migration chain'); } catch (error) { const operation = dropConstraints ? 'clean and drop constraints' : 'clean'; const message = error instanceof Error ? error.message : String(error); throw new Error(`Failed to ${operation}: ${message}`); } } } exports.CleanService = CleanService; //# sourceMappingURL=clean.service.js.map