How to start afresh with a new database in Django?

放肆的年华 提交于 2020-01-23 17:41:33

问题


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:


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



来源:https://stackoverflow.com/questions/40987039/how-to-start-afresh-with-a-new-database-in-django

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!