Skip to content

Conversation

@allanlasser
Copy link
Member

  • Updates migration numbering so Sunlight migration is applied.
  • Adds a CI check for migration conflicts for future PRs.

echo "$base_migrations" | grep "^.*/${num}_" | sed 's/^/ /'
done
echo ""
echo "Please renumber your migration to avoid conflicts."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrations should never be re-numbered - that wouldn't solve the conflict. The names are only for people to read. Each migration contains its dependencies (forming an acyclic graph) - there is a conflict if there are two leaf nodes. As long as the two paths do not touch the same fields (verified by a human), then the conflict can be solved by running manage.py makemigrations --merge which creates a merge migration, with both paths specified as its dependencies. This merges the paths, and with a single leaf node, there is no longer a conflict. So the correct error message here should be to rebase this branch onto master and run manage.py makemigrations --merge.

Checking for migrations with the same number on the separate branches does not check actual dependencies, but should catch errors correctly in practice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed this with updated guidance and used our inv manage command as the root command.

@allanlasser allanlasser temporarily deployed to squarelet-pi-hotfix-mig-ms86ie January 27, 2026 19:34 Inactive
@allanlasser allanlasser temporarily deployed to squarelet-pi-hotfix-mig-blapfr January 27, 2026 19:38 Inactive
@allanlasser allanlasser merged commit c5e114e into master Jan 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants