3 ms·
With Django migrations each migration needs to specify the migrations that have to be executed first - its dependencies. Usually this is a single ID, but multi
by simonw 5y ago
With Django migrations each migration needs to specify the migrations that have to be executed first - its dependencies.
Usually this is a single ID, but multiple IDs are supported.
Here's an example: https://github.com/CAVaccineInventory/vial/blob/0359ec1b44d09defd397e943c0b6d4a394ec6be8/vaccinate/core/migrations/0119_populate_source_location_point.py#L6 https://github.com/CAVaccineInventory/vial/blob/0359ec1b44d0...
This means that you can actually have two migrations with the same number and they won't break, provided they have correctly specified their dependencies.
Django has a mechanism whereby you can resolve conflicts caused by two people working in branches: https://docs.djangoproject.com/en/4.0/topics/migrations/#version-control https://docs.djangoproject.com/en/4.0/topics/migrations/#ver...
In practice though I've found it best to avoid these - as a developer I'll reconstruct my migration if I find someone else has landed one before I did, to keep things simple and linear.