Skip to content

Remove State.LastSchema method #909

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

Merged
merged 1 commit into from
Jun 17, 2025
Merged

Conversation

andrew-farries
Copy link
Collaborator

@andrew-farries andrew-farries commented Jun 16, 2025

Remove the State.LastSchema method and replace its usages with state.ReadSchema instead.

For validating migrations, we always want to validate against the current state of the db schema.

@github-actions github-actions bot temporarily deployed to Docs Preview June 16, 2025 07:37 Inactive
@andrew-farries andrew-farries marked this pull request as ready for review June 16, 2025 08:24
@andrew-farries andrew-farries requested a review from kvch June 16, 2025 08:24
@andrew-farries andrew-farries removed the request for review from kvch June 16, 2025 09:53
@andrew-farries andrew-farries requested a review from kvch June 16, 2025 10:37
@github-actions github-actions bot temporarily deployed to Docs Preview June 16, 2025 10:37 Inactive
Replace uses with `State.ReadSchema` instead. All usages of `LastSchema`
really want to work with the current schema.
@andrew-farries andrew-farries force-pushed the remove-state-last-schema-method branch from c671eaa to 03822ef Compare June 17, 2025 06:48
@github-actions github-actions bot temporarily deployed to Docs Preview June 17, 2025 06:49 Inactive
@andrew-farries andrew-farries force-pushed the remove-state-last-schema-method branch from 03822ef to c1007bf Compare June 17, 2025 06:53
@github-actions github-actions bot temporarily deployed to Docs Preview June 17, 2025 06:53 Inactive
Copy link

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgroll/pkg/roll 79.75% (ø)
github.com/xataio/pgroll/pkg/state 63.18% (-0.63%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgroll/pkg/roll/execute.go 79.41% (ø) 170 135 35
github.com/xataio/pgroll/pkg/state/state.go 55.25% (-1.30%) 181 (-10) 100 (-8) 81 (-2) 👎

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.

Changed unit test files

  • github.com/xataio/pgroll/pkg/state/state_test.go

@andrew-farries andrew-farries merged commit a75c3f6 into main Jun 17, 2025
30 checks passed
@andrew-farries andrew-farries deleted the remove-state-last-schema-method branch June 17, 2025 08:08
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.

2 participants