clear database (drop all tables)

40 views
Skip to first unread message

lars van Gemerden

unread,
Apr 29, 2015, 6:11:51 AM4/29/15
to django...@googlegroups.com
Hi all,

Is there a simple programmatic way to drop all tables in the database (e.g. for testing purposes), also without input prompts?

Cheers, Lars

Bill Freeman

unread,
Apr 29, 2015, 11:20:46 AM4/29/15
to django-users
With suitable privileges, you can drop the database and recreate it.  In at least some databases the user privilege grants are not lost with the database and don't have to be recreated when the database is.

And, if you're using SQLite, just remove the file.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0ebbbdb5-f9ad-437b-baaa-9a39358704cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Derek

unread,
Apr 29, 2015, 12:41:39 PM4/29/15
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages