表" auth_user"已经存在,从django转移到custom_user模型构建它的用户模型

时间:2016-03-09 21:22:20

标签: django django-migrations django-1.9 django-custom-user operationalerror

问题可能与source code类似,但错误&版本不同

我从Django移动到this situation模型构建了它的用户模型。 我正在使用的数据库是默认的,即sqllite,因为webapp的范围很小。

在所有修改之后,我尝试使用makemigrations / migrate命令修改模式,但是我收到了以下错误 django.db.utils.OperationalError: table "auth_user" already exists

当我使用Django1.9时,我想知道是否有任何内置选项/步骤来迁移数据而不删除/滥用数据库。

--fake-initial      Detect if tables already exist and fake-apply initial
                    migrations if so. Make sure that the current database
                    schema matches your initial migration before using
                    this flag. Django will only check for an existing
                    table name.

0 个答案:

没有答案