Search code examples
gitversion-controlstandardsdjango-migrations

Should Django Migration (makemigrations) commited separately than creating model?


It's vague for me which strategy is better in Version controlling of django or any other web framework:

  1. Commit separately for creating model and running makemigrations.
  2. Commit both tasks together.

I think myself first strategy is better, because of migration files which creating after running makemigrations. But I need to be sure which one in better. Is there any certain standard for this?


Solution

  • Both the strategies you list can work. But option one is better.

    You can commit Django Migration separate with other changes, so that changes for models can be tracked more clearly from commit histories.