Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start afresh with a new database in Django?

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 Answers

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

like image 90
MiniGunnR Avatar answered Oct 19 '25 13:10

MiniGunnR