From 89322f954ff026cda6b8d96f57f31f8a76de1cd8 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Thu, 10 Oct 2024 12:36:39 +0530 Subject: [PATCH] feat: add support for --compact-output flag in reset and refresh commands --- commands/migration/refresh.ts | 10 ++++++++++ commands/migration/reset.ts | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/commands/migration/refresh.ts b/commands/migration/refresh.ts index 4bf45694..171b50f5 100644 --- a/commands/migration/refresh.ts +++ b/commands/migration/refresh.ts @@ -45,6 +45,12 @@ export default class Refresh extends BaseCommand { @flags.boolean({ description: 'Run seeders' }) declare seed: boolean + /** + * Display migrations result in one compact single-line output + */ + @flags.boolean({ description: 'A compact single-line output' }) + declare compactOutput: boolean + /** * Disable advisory locks */ @@ -60,6 +66,10 @@ export default class Refresh extends BaseCommand { args.push('--force') } + if (this.compactOutput) { + args.push('--compact-output') + } + if (this.connection) { args.push(`--connection=${this.connection}`) } diff --git a/commands/migration/reset.ts b/commands/migration/reset.ts index af4af090..f62e5840 100644 --- a/commands/migration/reset.ts +++ b/commands/migration/reset.ts @@ -39,6 +39,12 @@ export default class Reset extends BaseCommand { @flags.boolean({ description: 'Do not run actual queries. Instead view the SQL output' }) declare dryRun: boolean + /** + * Display migrations result in one compact single-line output + */ + @flags.boolean({ description: 'A compact single-line output' }) + declare compactOutput: boolean + /** * Disable advisory locks */ @@ -54,6 +60,10 @@ export default class Reset extends BaseCommand { args.push('--force') } + if (this.compactOutput) { + args.push('--compact-output') + } + if (this.connection) { args.push(`--connection=${this.connection}`) }