cello icon indicating copy to clipboard operation
cello copied to clipboard

Remove migrations from image entrypoints

Open dodo920306 opened this issue 6 months ago • 0 comments

Removed python manage.py makemigrations from Docker entrypoint to prevent inconsistent or duplicate migration generation during container startup.

Previously, every time a new container was built, makemigrations regenerated the migration files from scratch. If the previous container’s migrations were not persisted, Django would recreate 0001_initial.py, ignoring actual DB schema state. This caused issues when existing tables had column changes: Django would not detect diffs and silently skip necessary migrations, leaving the schema out of sync.

Thus, migrations should be included in the version control and so that they can be applied but not regenerated in the runtime (inside containers).

Note: Ensure all future model changes include corresponding migration files.

dodo920306 avatar Jun 15 '25 12:06 dodo920306