问题
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