The --fake-initial option can be used to allow Django to skip an app’s initial migration if all database tables with the names of all models created by all CreateModel operations in that migration already exist. This option is intended for use when first running migrations against a database that preexisted the use of migrations. This option does not, however, check for matching database schema beyond matching table names and so is only safe to use if you are confident that your existing schema matches what is recorded in your initial migration.
我在Ubuntu18.04+Postgres10.10版本的Django2.2.7或Django3.0上解决了这个问题。
我授予用户在该特定数据库上的所有权限,它解决了问题。
项目上的初始迁移有时会遇到问题,使用--伪初始
这是1.8的新版本。在1.7中,-fake initial是一个隐式默认值,但在1.8中是显式的。
从文档中:
https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---fake-initial
相关问题 更多 >
编程相关推荐