Skip to content

Instantly share code, notes, and snippets.

@xtornasol512
Created October 27, 2021 17:19
Show Gist options
  • Save xtornasol512/994631c37cfcc8abef874d668ee9d1f5 to your computer and use it in GitHub Desktop.
Save xtornasol512/994631c37cfcc8abef874d668ee9d1f5 to your computer and use it in GitHub Desktop.
Drop tables using django and sql commands

DROP A TABLE django

python manage.py dbshell

\dt drop table

python manage.py migrate --fake <app_name> zero

find . -path "/migrations/.py" -not -name "init.py" -delete find . -path "/migrations/.pyc" -delete

python manage.py makemigrations <app_name>

python manage.py migrate <app_name> --fake-initial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment