Problem Statement: I want to drop some tables in a databases.
Error getting: a foreign key constraint fails
Details:
I have a pre-existing (not populated by django models.py) database. I am using django. I used this database for creating django site. I have given its name and proper setting while creating a site in django. There are no models in created in models.py.
After executing command:
python manage.py syncdb
Django added following tables to that database:
| auth_group |
| auth_group_permissions |
| auth_permission |
| auth_user |
| auth_user_groups |
| auth_user_user_permissions |
| django_content_type |
| django_session |
| django_site |
I want to drop all these tables.
I tried this query;
DROP TABLE table_name;
but mysql prompted with error showing:
ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
Is there some way I can drop only above mentioned tables keep my pre-existing tables intact?
Thank you.