上QQ阅读APP看书,第一时间看更新
How to do it...
Execute the following steps:
- Migrate all of your apps to the latest South migrations, as follows:
(myproject_env)$ python3 manage.py migrate
Remove south from INSTALLED_APPS, in the settings.
- For each app with South migrations, delete the migration files and leave only the migrations directories.
- Create new migration files with the following command:
(my_project)$ python3 manage.py makemigrations
- Fake the initial Django migrations, as the database schema has already been set correctly:
(my_project)$ python3 manage.py migrate --fake-initial
- If there are any circular relationships in the installed apps (that is, two models in different apps pointing to each other with a foreign key or many-to-many relation), apply the fake initial migrations to each of these apps separately, as follows:
(my_project)$ python3 manage.py migrate --fake-initial demo_app