Skip to content

Instantly share code, notes, and snippets.

@Yogendra0Sharma
Forked from citmusa/rawSQL.py
Created January 12, 2017 08:41
Show Gist options
  • Save Yogendra0Sharma/1948654aa2b0e62825af531508a11e39 to your computer and use it in GitHub Desktop.
Save Yogendra0Sharma/1948654aa2b0e62825af531508a11e39 to your computer and use it in GitHub Desktop.
delete heroku - postgress table
python manage.py shell:
>>> sql = '''drop table mytable cascade;
... drop table mytable2; '''
>>>
>>> from django.db import connections, transaction
>>> cursor = connections['default'].cursor()
>>> cursor.execute(sql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment