How to track Django model changes with git?
All changes to models should be in migrations. If you "need to run a few custom SQL queries and/or run some Python code to update values" then those are migrations too, and should be written in a migration file.
Suppose you write a Django website and use git to manage the source code. Your website has various instances (one for each developer, at least).
When you perform a change on the model in a commit, everybody needs to update its own database. In some cases it is enough to run python manage.py migrate, in some other cases you need to run a few custom SQL queries and/or run some Python code to update values at various places.
How to automate this? Is there a clean way to bundle these "model updates" (for instance small shell scripts that do the appropriate actions) in the associated commits? I have thought about using git hooks for that, but as the code to be run changes over time, it is not clear to me how to use them for that purpose.