Fix: stop ignoring migration files in .gitignore, commit missing migrations#25
Open
ImranFarhat01 wants to merge 1 commit into
Open
Fix: stop ignoring migration files in .gitignore, commit missing migrations#25ImranFarhat01 wants to merge 1 commit into
ImranFarhat01 wants to merge 1 commit into
Conversation
…Bug 16) Root cause: .gitignore had a bare 'migrations' pattern that silently excluded every Django migration file repo-wide, not just for saveAPI. Only a couple of migrations/__init__.py files were ever committed before this rule existed; every actual migration (0001_initial.py etc, including saveAPI's pinned field migration) only ever existed on individual developers' local disks. This meant a fresh clone + migrate produced a database missing columns that the application code expects (e.g. StateSave.pinned), causing 500 errors on /api/save and /api/save/list. Fix: - Remove the 'migrations' line from .gitignore - Commit the current, verified-consistent migration files for every app (confirmed via 'makemigrations --check --dry-run' showing 'No changes detected' against the current develop model state) This includes the previously-missing saveAPI.0002_statesave_pinned migration that caused the originally reported 500 error.
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.
Problem
Dashboard shows a 500 error on a fresh database setup when loading
saved circuits.
Root Cause
.gitignore excludes all Django migration files from git, repo-wide.
This means migration files only ever existed on individual
developers' machines, never in the actual repo. A fresh clone and
migrate produces a database missing columns the code expects,
including StateSave.pinned.
Fix
Testing
Wiped database, rebuilt containers from scratch, ran migrate using
only what's in this PR, loaded fixtures, opened Dashboard. No error,
loads correctly.
Note
This affects migration tracking for every app, not just saveAPI. If
you have your own local migration files for changes not yet on
develop, it's worth checking before pulling this in, just to avoid
filename clashes. Happy to help sort out anything that comes up.