Skip to content

fix(cli): rollback --step default + surface query error causes#30

Merged
3m1n3nc3 merged 1 commit into
mainfrom
fix/rollback-step-and-error-surfacing
Jul 5, 2026
Merged

fix(cli): rollback --step default + surface query error causes#30
3m1n3nc3 merged 1 commit into
mainfrom
fix/rollback-step-and-error-surfacing

Conversation

@3m1n3nc3

@3m1n3nc3 3m1n3nc3 commented Jul 5, 2026

Copy link
Copy Markdown
Member

Two CLI regressions found by running the built CLI against Postgres:

  • migrate:rollback with no --step failed with '--step must be a positive integer'. musket returns an empty string (not undefined) for a declared but unpassed value option, so Number('') = 0 tripped the validation. Treat null/undefined/'' alike as 'not provided' (default: the last batch). The test option mocks hid this by returning undefined for unset options.

  • The db command printed only the generic 'Raw query execution failed for the Kysely adapter' wrapper, hiding the real error. It now appends the underlying cause (e.g. 'relation "x" does not exist').

Tests: rollback with step='' rolls back the last batch; db appends the cause behind a wrapper error.

Two CLI regressions found by running the built CLI against Postgres:

- migrate:rollback with no --step failed with '--step must be a positive
  integer'. musket returns an empty string (not undefined) for a declared but
  unpassed value option, so Number('') = 0 tripped the validation. Treat
  null/undefined/'' alike as 'not provided' (default: the last batch). The
  test option mocks hid this by returning undefined for unset options.

- The db command printed only the generic 'Raw query execution failed for the
  Kysely adapter' wrapper, hiding the real error. It now appends the
  underlying cause (e.g. 'relation "x" does not exist').

Tests: rollback with step='' rolls back the last batch; db appends the cause
behind a wrapper error.
@3m1n3nc3 3m1n3nc3 merged commit 6840624 into main Jul 5, 2026
6 checks passed
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant