@authup/server-api
Version:
This is a standalone application.
34 lines • 1.16 kB
JavaScript
/*
* Copyright (c) 2022.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.MigrationStatusCommand = void 0;
const typeorm_1 = require("typeorm");
const config_1 = require("../../config");
const database_1 = require("../../database");
class MigrationStatusCommand {
constructor() {
this.command = 'migration:status';
this.describe = 'Status of database migrations.';
}
async handler(args) {
await (0, config_1.setupConfig)();
const options = await (0, database_1.buildDataSourceOptions)();
const dataSource = new typeorm_1.DataSource(options);
await dataSource.initialize();
try {
await dataSource.showMigrations();
// eslint-disable-next-line no-useless-catch
}
finally {
await dataSource.destroy();
}
process.exit(0);
}
}
exports.MigrationStatusCommand = MigrationStatusCommand;
//# sourceMappingURL=migration-status.js.map
;