morpheus4j
Version:
Morpheus is a migration tool for Neo4j. It aims to be a simple and intuitive way to migrate your database.
39 lines • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const config_service_1 = require("../services/config.service");
const create_service_1 = require("../services/create.service");
const logger_1 = require("../services/logger");
const shared_flags_1 = require("../shared-flags");
class Create extends core_1.Command {
static args = {
name: core_1.Args.string({
description: 'Name of the migration (will be prefixed with a semver number)',
name: 'name',
required: true,
}),
};
static description = 'Generate a new timestamped migration file with boilerplate code';
static enableJsonFlag = true;
static examples = [
'<%= config.bin %> create add-user-nodes',
'<%= config.bin %> create update-relationships -m ~/path/to/migrations',
'<%= config.bin %> create update-relationships --config ./custom-config.json',
];
static flags = {
...shared_flags_1.ConfigFlags,
};
async run() {
const { args, flags } = await this.parse(Create);
logger_1.Logger.initialize(flags.json, flags.debug);
try {
const config = config_service_1.ConfigService.loadWithOutValidation(flags, flags.configFile);
await new create_service_1.CreateService(config).generateMigration(args.name);
}
catch (error) {
this.error(error instanceof Error ? error.message : String(error));
}
}
}
exports.default = Create;
//# sourceMappingURL=create.js.map