Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
provokateurin opened this issue Sep 12, 2024 · 0 comments
Open

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

provokateurin opened this issue Sep 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@provokateurin
Copy link
Collaborator

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)
@provokateurin provokateurin added the bug Something isn't working label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant