Instruction file imported from fao102/Style-Finder (
.github/instructions/django-migrations.instructions.md). Copyright stays with the author.
Django Migration Guidelines
- Never hand-edit generated migration files unless fixing a merge conflict or squashing migrations.
- Always generate migrations with:
python manage.py makemigrations app - Apply with:
python manage.py migrate - The
entry.shcontainer entrypoint runsmigrate --noinputautomatically on every deploy, so new migrations are applied at startup on Railway. - Migration files must be committed to version control — they are not in
.gitignore. - The current migration history:
0001_initial— createsOutfitSearchwithimageandcreated_at.0002_outfitsearch_color_...— addscolor,fit,gender,outfit_type,style_summary(all nullable).
- When adding a new field to
OutfitSearch, make itblank=True, null=Trueso existing rows are not broken. - Do not delete or rename existing migration files; use
squashmigrationsif the history becomes unwieldy.