3

In Django 1.10.6, I made a model, and ran python manage.py makemigrations and python manage.py migrate, it created a table in MySQL DB. Later I came to know that the table was not required. I searched and found an answer here. But that was for the versions before 1.9. In Django 1.9 sqlclear has been removed. Now my doubt is,

how can I drop a table from the DB using Django, for versions greater than 1.9?

Is there any sqlclear equivalent in versions greater than 1.9?

Kindly help.

Jeril
  • 7,858
  • 3
  • 52
  • 69

1 Answers1

2
1. Delete your Model for the Table or comment it out totally
2. python manage.py makemigrations 
3. python manage.migrate

hope it helps

Exprator
  • 26,992
  • 6
  • 47
  • 59
  • Thanks for the reply. But this is getting affected by the previous migration files. For e.g., I had a function for image upload, and its is throwing an `AttributeError` because of that from the previous migration files. – Jeril Jun 20 '17 at 04:44
  • 1
    so you need to delete the migrations files except the init.py file in the migrations folder – Exprator Jun 20 '17 at 04:47
  • Did you got what you wanted bro – Exprator Jun 20 '17 at 05:17
  • I had to comment out all those lines causing `AttributeError` in the `migrations file`. Now its working. Thanks. – Jeril Jun 20 '17 at 05:40