Skip to content

Commit

Permalink
fix(cli): improve success message of schema:update/drop commands
Browse files Browse the repository at this point in the history
It now reports whether the schema is already up-to-date instead of printing
empty line and a message about schema being updated. Also the success message
is removed with `--dump` flag if there are queries.
  • Loading branch information
B4nan committed Sep 13, 2022
1 parent 67d3c68 commit 11d0fd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/cli/src/commands/SchemaCommandFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ export class SchemaCommandFactory {
if (args.dump) {
const m = `get${method.substr(0, 1).toUpperCase()}${method.substr(1)}SchemaSQL` as 'getCreateSchemaSQL' | 'getUpdateSchemaSQL' | 'getDropSchemaSQL';
const dump = await generator[m](params);
CLIHelper.dump(dump, orm.config);

if (dump) {
CLIHelper.dump(dump, orm.config);
successMessage = '';
} else {
successMessage = 'Schema is up-to-date';
}
} else if (method === 'fresh') {
await generator.dropSchema(params);
await generator.createSchema(params);
Expand Down

0 comments on commit 11d0fd9

Please sign in to comment.