Skip to content

Fix: stop ignoring migration files in .gitignore, commit missing migrations#25

Open
ImranFarhat01 wants to merge 1 commit into
FOSSEE:developfrom
ImranFarhat01:fix/missing-pinned-migration
Open

Fix: stop ignoring migration files in .gitignore, commit missing migrations#25
ImranFarhat01 wants to merge 1 commit into
FOSSEE:developfrom
ImranFarhat01:fix/missing-pinned-migration

Conversation

@ImranFarhat01

Copy link
Copy Markdown

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

  • Remove the migrations rule from .gitignore
  • Add the current migration files for every app to the repo

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.

…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.
@ImranFarhat01 ImranFarhat01 changed the title Fix: stop ignoring migration files in .gitignore, commit missing migrations (Bug 16) Fix: stop ignoring migration files in .gitignore, commit missing migrations Jun 16, 2026
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