rucken
Version:
Console tools and scripts for nx and not only that I (EndyKaufman) use to automate the workflow and speed up the development process
56 lines • 2.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MigrateCommands = void 0;
const tslib_1 = require("tslib");
/* eslint-disable @typescript-eslint/no-unused-vars */
const nestjs_console_1 = require("../../nestjs-console");
const utils_service_1 = require("../utils/utils.service");
const migrate_config_1 = require("./migrate.config");
let MigrateCommands = class MigrateCommands {
utilsService;
migrateConfig = {};
constructor(utilsService) {
this.utilsService = utilsService;
this.migrateConfig = this.utilsService.getRuckenConfig(migrate_config_1.DEFAULT_MIGRATE_CONFIG).migrate;
}
async migrate({ dryRun, databaseUrl, locations, historyTable, sqlMigrationSuffixes, }) {
throw new Error('The migration command has been moved to the project https://github.com/EndyKaufman/pg-tools and is published as a console utility https://www.npmjs.com/package/pg-flyway');
}
};
exports.MigrateCommands = MigrateCommands;
tslib_1.__decorate([
(0, nestjs_console_1.Command)({
command: 'migrate',
description: 'database migration tool, NodeJS version of Java migration tool - flyway, supported databases: PostrgeSQL',
options: [
{
flags: '--dry-run [boolean]',
description: 'show content of migrations without apply them in database (default: false)',
},
{
flags: '--database-url [strings]',
description: 'database url for connect (example: postgres://POSTGRES_USER:POSTGRES_PASSWORD@localhost:POSTGRES_PORT/POSTGRES_DATABASE?schema=public)',
},
{
flags: '-l,--locations [strings]',
description: 'locations with migration files (default: migrations)',
},
{
flags: '-t,--historyTable [strings]',
description: 'history table with states of migration (default: __migrations)',
},
{
flags: '-f,--sql-migration-suffixes [strings]',
description: 'extension of migration files (default: .sql)',
},
],
}),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", [Object]),
tslib_1.__metadata("design:returntype", Promise)
], MigrateCommands.prototype, "migrate", null);
exports.MigrateCommands = MigrateCommands = tslib_1.__decorate([
(0, nestjs_console_1.Console)(),
tslib_1.__metadata("design:paramtypes", [utils_service_1.UtilsService])
], MigrateCommands);
//# sourceMappingURL=migrate.commands.js.map