Skip to content

fix: commit missing migrations (dev companion to #167) - #168

Merged
saqibmanan merged 1 commit into
devfrom
fix/missing-publication-migration-dev
Sep 11, 2026
Merged

fix: commit missing migrations (dev companion to #167)#168
saqibmanan merged 1 commit into
devfrom
fix/missing-publication-migration-dev

Conversation

@saqibmanan

Copy link
Copy Markdown
Contributor

Companion to #167 — same commit, cherry-picked onto `dev` cleanly (no conflicts). See #167 for the full story.

Blocked the production deploy's release step: `search_index --populate`
crashed with `relation "publication" does not exist`. Root cause traced
much further than expected.

.gitignore had `api/migrations/*` and `authorization/migrations/*` --
every migration generated for either app since whenever that was added has
been silently invisible to git, no matter how many times someone ran
`git add`. This repo's `api/migrations/` only ever had `0001_initial.py`
committed (likely force-added once, or predates the ignore rule);
`authorization/migrations/` had nothing at all, not even `__init__.py`.

Confirmed via git log this wasn't always broken: `30480c6 "reset
migrations"` deliberately squashed history down to one clean
`0001_initial.py` at some point (a legitimate, intentional cleanup,
probably around a Postgres migration). But nothing was ever committed
again afterward -- every migration generated since (via normal
`makemigrations` + `git add`, silently swallowed by the ignore rule) only
ever existed on whichever host it was generated on. dev-cds's live
checkout had the full, real, working set: 46 files for `api`
(0002-0047, ending in the Publication/ResourceType migration this deploy
needed) and all 5 for `authorization` (0001-0004 + __init__.py, defining
`authorization.User` itself -- AUTH_USER_MODEL).

Pulled all 51 files directly from dev-cds (read-only), verified:
- Every file compiles clean (`py_compile`).
- The full api dependency chain is linear and unbroken, 0001 -> 0047, no
  gaps, no branches.
- authorization's 4 files chain cleanly from 0001, which itself correctly
  depends on api/0023 (a real cross-app FK relationship) -- confirms the
  two apps' histories are genuinely interleaved and consistent, not
  independently drifted.
- No overlap with the deliberately-excluded fetch_resource_data feature
  from the earlier dev/main reconciliation (PR #153) -- the two incidental
  substring matches found were unrelated migration filenames.

Removed both ignore rules. Django migrations must always be committed;
there is no legitimate reason to exclude them.

This also means any genuinely fresh database (a new contributor's local
setup, a CI job with --create-db, a disaster-recovery rebuild) has been
silently unable to reach current schema this whole time -- would have
stopped dead at whatever 0001_initial.py defines. That risk is now closed.
@saqibmanan
saqibmanan merged commit cced8c6 into dev Sep 11, 2026
3 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