Repository navigation
fix: drop the ID sequences in the teardown script - #273
Merged
Merged
Conversation
The four viron.*_id_seq sequences are standalone, so DROP TABLE ... CASCADE left them behind and a re-run setup kept counting from the old values. The teardown now drops them, and a test runs the real setup and teardown scripts against H2 to pin that ids restart at 1. Closes #272 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (performed inline. The Copilot reviewer could not be added:
Observations to weigh:
Summary: ready for human review. This PR is held from autonomous merge only because it touches This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
db-scripts/teardown/delete_tables.sqlnow drops the fourviron.*_id_seqsequences after the tables. They are standalone (notOWNED BYa column), soDROP TABLE ... CASCADEleft them behind, and a re-run of setup (CREATE SEQUENCE IF NOT EXISTS) kept counting from the old values. This is option 1 from The teardown script leaves the ID sequences behind, so a reset database does not restart IDs at 1 #272. Thevironschema is left in place: dropping it was optional in the issue, and keeping it avoids deleting anything the teardown never created.TeardownScriptTestreads the realcreate_sequences.sqlanddelete_tables.sqlfiles and runs them against H2 in PostgreSQL mode. It advances every sequence, tears down, sets up again, and asserts that each sequence starts at 1. A second test confirms the teardown still runs against an empty schema.Closes #272
Test plan
mvn -B test: 682 tests run, 0 failures.delete_tables.sqlreverted tomain,TeardownScriptTestfails (expected: 1 but was: 4). With the fix restored, it passes.DROP SEQUENCE IF EXISTSis standard PostgreSQL syntax, but a manual run ofpsql -f db-scripts/teardown/delete_tables.sqlfollowed by setup is recommended before merge.Merge note
This PR touches
db-scripts/*, which is on the dev loop's do-not-auto-merge list. It is left open for human review.Deferred issues
.github/workflows/*, which is gated, and is larger in scope.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code