Last active
February 4, 2020 17:33
-
-
Save michaelhelmick/7e6c6f3fb0cdd9821ed2504df7398627 to your computer and use it in GitHub Desktop.
Django Migration Conflicts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIGRATION_CONFLICTS=$(shell find . -name "*.py" | grep -o ".*migrations/[0-9]\+" | sort | uniq -c | awk '$$1 > 1 {print $$0}') | |
migration-conflicts: | |
@if [ "${MIGRATION_CONFLICTS}" = "" ]; then \ | |
echo "No migration conflicts found."; \ | |
else \ | |
echo "The following migration conflicts found:" && \ | |
echo "${MIGRATION_CONFLICTS}" && exit 1; \ | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment