Skip to content

Conversation

@andrew-farries
Copy link
Collaborator

Add an --expect-one flag to the pgroll migrate command to allow the command to fail if there is more than one outstanding migration.

From the documentation added in this PR:


By default, pgroll migrate will apply all unapplied migrations. However, it may sometimes be desirable to only apply a single migration to ensure that an existing version schema is not removed by a sequence of migrations. In this case, running:

$ pgroll migrate examples/ --expect-one

will cause the command to fail if more than one unapplied migration is detected.

@github-actions github-actions bot temporarily deployed to Docs Preview December 8, 2025 10:30 Inactive
Abort the command if there is more than one unapplied migration.
Document the `--expect-one` flag for the `pgroll migrate` command.
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgroll/cmd 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgroll/cmd/migrate.go 0.00% (ø) 61 (+3) 0 61 (+3)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@andrew-farries andrew-farries marked this pull request as ready for review December 8, 2025 10:35
@andrew-farries andrew-farries merged commit 1a3880f into main Dec 10, 2025
34 checks passed
@andrew-farries andrew-farries deleted the expect-one-migrate-flag branch December 10, 2025 12:39
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.

5 participants