3

I deleted my database. I want to start afresh with a new database. How can I do that ? I tried making a new datasource but it gives me an error while applying migrations/or migrating that it couldn't find the tables? Which is true because its an empty database.

A similar scenario would be when some one pulls a version of my code. He wouldn't have migrations or the database (untracked). How would he run the application?

1 Answers1

4

Delete all the folders named 'migrations'. And go to terminal and run ./manage.py makemigrations, ./manage.py migrate --run-syncdb.

nak
  • 690
  • 6
  • 15
MiniGunnR
  • 5,590
  • 8
  • 42
  • 66
  • 1
    Do not remove the whole folders, and keep the `__init__.py` files. Otherwise you'll have issues when trying to create the tables with `makemigrations` and `migrate` as discussed [here](https://stackoverflow.com/questions/46391330/relation-does-not-exist-error-in-django) – mota Dec 22 '20 at 14:30