Fix migrate apply --ask silently skipping every accepted/already-done migration - #21
Merged
Merged
Conversation
…r queue The worker thread applying queued migrations and the --ask review loop both write to the tqdm bar, but only individual write calls were locked (2cbacb5) — the worker could still print an "Applied ..." status line mid-render of the next file's SQL or the confirm prompt itself. Hold bar_lock across the whole show-file+prompt step so worker output defers until the question is answered, instead of interleaving with it. Bump version to 0.3.5. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqXjRpDFprwfALdveFDewa
… migrations Detect when every statement in a migration is a create-if-missing shape (CREATE TABLE/INDEX/SEQUENCE/VIEW/SCHEMA IF NOT EXISTS, or ALTER TABLE ADD COLUMN) whose target already exists in the database, and skip the prompt entirely in that case — record it as already done instead of asking. CREATE OR REPLACE and any other statement shape are never auto-detected, since existence alone doesn't mean re-running would be a no-op. Bump version to 0.3.6. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqXjRpDFprwfALdveFDewa
… migration The trailing bar_step()/continue at the end of the answer if/elif chain weren't re-indented when the auto-detect branch's else: added a nesting level, so they fired unconditionally after the chain instead of only on the unrecognized-answer path — meaning answering "y" (default accept) or "a" (already done) fell through to bar_step()/continue before reaching work_q.put(), so the migration was never enqueued, applied, or recorded. Caught by /code-review. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqXjRpDFprwfALdveFDewa
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.
No description provided.