Last active
October 16, 2024 15:51
-
-
Save felipe3dfx/ea37e038301e17ab335c742d07eff882 to your computer and use it in GitHub Desktop.
Reset django migrations
This file contains 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
1. Remove old migrations file | |
sudo find . -path "*/migrations/*.py" -not -name "__init__.py" -not -path "./.venv/*" -delete | |
sudo find . -path "*/migrations/*.pyc" -not -path "./.venv/*" -delete | |
2. Make migrations again | |
python manage.py makemigrations | |
3. Truncate django_migrations table | |
TRUNCATE TABLE django_migrations; | |
4. Migrate with fake | |
python manage.py migrate --fake | |
5. reload services |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment