没有合适的资源?快使用搜索试试~ 我知道了~
首页模型迁移错误常见问题”django.db.utils.InternalError: (1050, “Table ‘django_content_type’ already exists”)”
模型迁移错误常见问题”django.db.utils.InternalError: (1050, “Table ‘django_...
![](https://csdnimg.cn/release/wenkucmsfe/public/img/star.98a08eaa.png)
django迁移模型常见错误django.db.utils.InternalError: (1050, “Table ‘django_content_type’ already exists”)” 这个问题经常出现在迁移模型时报错,表示该表已经存在,说明之前进行过模型的迁移操作。 例如: 一般情况下出现这种错误,是因为在迁移过后进行了数据表的修改【字段的修改】,而再次进行数据表的迁移便会报错,因为之前该表已经存在,重复迁移。 解决办法: 1、先删除模块中迁移时生成的文件xxx_.initial.py文件 如: 0001_initial.py文件 注意:只删除该文件 2、然后依次输入以下命令
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/14911513/bg1.jpg)
模型迁移错误常见问题模型迁移错误常见问题”django.db.utils.InternalError: (1050, “Table
‘django_content_type’ already exists”)”
django迁移模型常见错误迁移模型常见错误django.db.utils.InternalError: (1050, “Table ‘django_content_type’ already exists”)”
这个问题经常出现在迁移模型时报错,表示该表已经存在,说明之前进行过模型的迁移操作。
例如:
一般情况下出现这种错误,是因为在迁移过后进行了数据表的修改【字段的修改】,而再次进行数据表的迁移便会报错,因为之前该表已经存在,重复迁移。
解决办法:
1、先删除模块中迁移时生成的文件xxx_.initial.py文件
如: 0001_initial.py文件
注意:只删除该文件
2、然后依次输入以下命令
1、python manage.py makemigrations --fake
2、python manage.py migrate --fake
输入后的结果如下:
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/default.jpg!1)
weixin_38681318
- 粉丝: 2
- 资源: 888
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
会员权益专享
最新资源
- 基于Springboot的医院信管系统
- 基于Springboot的冬奥会科普平台
- 基于Springboot的社区医院管理服务系统
- 基于Springboot的实习管理系统
- TI-TCAN1146.pdf
- 基于Springboot的留守儿童爱心网站
- S32K3XXRM.pdf
- Ansible Automation Platform 快速安装指南 v3.8.1
- Ansible Tower 发行注记 v3.8.1-76页
- C语言笔记-考研版(进阶)
- Design_of_Analog_CMOS_Integrated_Circuit20200602-85440-9wt61m-with-cover-page-v2 (1).pdf
- Ansible Automation Platform 安装和参考指南 v3.8.1-59页
- 浅析5G技术在工业互联网领域的应用研究
- 查重17 岑彩谊-基于otn技术的本地承载网-二稿 .docx
- 自考计算机应用基础知识点.doc
- 数据库系统安全、技术操作规程.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)