Skip to main content

Python database migrations

 I've gotten extremely comfortable with the commands "manage.py makemigrations" and "manage.py migrate" but today I learnt a new database related command.

manage.py migrate [insert app name] zero

😮😮😮😮😮

This simple command is the Ctrl-Z for migrations. It drops the tables for the app. All this while, whenever I have trouble with any of the tables I delete the entire database when I could have been deleting that table alone. oops 😁

Comments