fix: restore deleted j0k1 migration to keep released chain resolvable - #17
Merged
Conversation
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.
Description
Fixes a startup crash on existing databases. PR #15 deleted a released Alembic migration,
j0k1l2m3n4o5(schema_freeze_vendor_mappings), and rewired the chain to skip it. Any database that was stamped at that revision (it was the chain head between 2026-07-23 and 2026-08-13) can no longer resolve its current revision, soalembic upgrade headfails at app startup with:Alembic migrations must never be deleted once released — the scripts directory and the DB's
alembic_versiontable must always agree.Changes:
j0k1l2m3n4o5_schema_freeze_vendor_mappings.pywith its original content. Itsupgrade()is a safe no-op on fresh databases (h4d5e6f7a8b9already createsvendor_mappings) and skips when the table exists, so re-adding it has no effect on new installs. Added a docstring NOTE that this released revision must never be deleted.k2l3m4n5o6p7_add_notification_outbox.pyback todown_revision = j0k1l2m3n4o5, restoring the original single linear chain with one head (m6n7o8p9q0r1). Also made itsnotification_outboxcreation defensive (skips when the table already exists) socreate_all-built databases upgrade cleanly.The affected databases need no manual fix — re-running the app's startup migration now resolves from
j0k1l2m3n4o5to head automatically.Type of Change
Affected Components
http_policy.py)Testing
pytest— all tests pass (359 passed, 15 skipped)ruff check . && ruff format .— no lint errorspython scripts/verify_sources.py— all sources resolve (if sources were added or modified)Migration
Notes:
No new schema change — this restores a previously released revision so
alembic upgrade headresolves on existing databases. The restoredj0k1l2m3n4o5.upgrade()is a no-op (table already created by an earlier migration). Thek2l3m4n5o6p7outbox creation is now defensive against pre-existing tables fromcreate_all-built databases.Policy Checklist
AI Layer Changes
N/A — no prompt, schema, or provider logic changed.
Additional Notes
Verification:
alembic historyandalembic headsshow a single linear chain with one head (m6n7o8p9q0r1);tests/test_migrations.pyenforces the single-head/linear invariant and passes; full suite is green.