Skip to content

CLI help is displayed in terminal when something goes wrong #32

@provokateurin

Description

@provokateurin

Description

The error is not related to the CLI options, so they shouldn't be shown.

Steps To Reproduce

  1. Write some faulty CHECK constraint
  2. Run trek generate

Relevant log output

2024/09/12 18:48:56 Changes detected
2024/09/12 18:48:59 Generating migration statements
Error: failed to generate migration statements: failed to execute target sql: failed to execute target sql: ERROR: operator does not exist: timestamp with time zone > integer (SQLSTATE 42883)
Usage:
  trek generate [migration-name] [flags]

Flags:
      --check       Run checks after generating the migration (default true)
      --cleanup     Remove the generated migrations file. Only works with --dev (default true)
      --dev         Watch for file changes and automatically regenerate the migration file
  -h, --help        help for generate
      --overwrite   Overwrite existing files
      --stdout      Output migration statements to stdout

Global Flags:
      --force-embedded-migra   Force using the embedded migra binary instead of the system one.

failed to generate migration statements: failed to execute target sql: failed to execute target sql: ERROR: operator does not exist: timestamp with time zone > integer (SQLSTATE 42883)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions