Skip to content

chore(migrations): fold the post-v2.5.5 migrations into one - #994

Merged
ajslater merged 1 commit into
developfrom
fold-v2-5-6-migrations
Oct 22, 2026
Merged

ajslater merged 1 commit into
developfrom
fold-v2-5-6-migrations

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Folds the three migrations added since v2.5.5 into one, 0058_post_v2_5_5_schema, as #909 did for the post-v2.3.3 chain.

v2.5.5 shipped through 0057, so none of these has reached a release. An upgrading install now applies one migration instead of three.

Folded

Old migration Change
0058_series_fields Series start/end year, status, summary
0059_series_filters_and_fts_summary Series filter columns; FTS drop and recreate with series_summary
0060_backfill_metadata_imported_at metadata_imported_at backfill (#992)

Operations keep their order. The FTS SQL constants and the backfill function were copied verbatim from the old files by script. tests/test_lazy_import_marker.py imported the backfill by module path and is repointed at the folded module.

Verification

All checks were run on scratch databases (CODEX_CONFIG_DIR), by diffing sqlite_master dumps:

  • a fresh migrate through the fold and through the old chain give identical schemas;
  • upgrading a database at 0057 (the v2.5.5 path) gives the same schema;
  • rolling the fold back gives exactly the 0057 schema.

makemigrations --check reports no changes. make lint and make ty are clean. make test: 1753 passed, 1 xfailed; frontend 1033 passed.

Dev databases

A database that already applied the old 0058–0060 will try to apply the renamed migration again and fail on a duplicate column. Rebuild it, or, only if all three old ones were applied, run:

PYTHONPATH=. uv run python bin/manage.py migrate codex 0058_post_v2_5_5_schema --fake

🤖 Generated with Claude Code

v2.5.5 shipped through 0057, so 0058 through 0060 have never reached a
release and no install in the wild has applied them. Fold them into
0058_post_v2_5_5_schema, as #909 did for the post-v2.3.3 chain, so an
upgrading install applies one migration.

Operations keep their order: the series fields, the series filter
columns, the FTS drop and recreate with series_summary, then the
metadata_imported_at backfill. The FTS SQL and the backfill were copied
verbatim from the old files.

Verified on scratch databases: a fresh migrate of the fold and of the
old chain give identical sqlite_master schemas, as does an upgrade from
0057. Rolling the fold back gives the 0057 schema. makemigrations
--check reports no changes.

tests/test_lazy_import_marker.py imported the backfill by module path
and is repointed at the folded module.

A dev database that already applied the old 0058-0060 needs to be
rebuilt or `migrate codex 0058_post_v2_5_5_schema --fake`. A renamed
migration is one the recorder has never seen, so it would re-apply and
fail on a duplicate column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit dde59c5 into develop Oct 22, 2026
8 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