[Python] What should be the best practice for handling migration files in Django when multiple...

Discussão em 'Python' iniciado por Stack, Abril 13, 2025.

  1. Stack

    Stack Membro Participativo

    I have a question regarding Django migration files and version control. When I run migration commands in Django python manage.py makemigrations and python manage.py migrate, files such as 0001_initial.py are created. I've come across differing opinions online about whether migration files should be committed to Git or added to .gitignore. Some suggest ignoring them, while others recommend committing them and squashing when necessary.

    Could someone explain the scenarios that arise when multiple developers commit migration files, what issues or errors might occur, and how we can avoid these problems in a collaborative environment?

    I am new to Django. Thanks

    Continue reading...

Compartilhe esta Página