Skip to content

Fix migrate apply --ask silently skipping every accepted/already-done migration - #21

Merged
aersam merged 3 commits into
mainfrom
fix-migrate-ask-queue-interleave
Sep 1, 2026
Merged

Fix migrate apply --ask silently skipping every accepted/already-done migration#21
aersam merged 3 commits into
mainfrom
fix-migrate-ask-queue-interleave

Conversation

@aersam

@aersam aersam commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

aersam and others added 3 commits September 1, 2026 16:18
…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
@aersam
aersam merged commit b1b4ef0 into main Sep 1, 2026
2 checks passed
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