django 修改字段后,同步数据库,失败:django.db.utils.InternalError: (1054, "Unknown column 'api_config.project_id_id' in 'field list'")
问题原因是,修改字段后,同步失败了,然后执行查询的时候,就会提示这个错误,这个字段没有
最暴力的方法可以直接在数据库中修改字段,但是修改后,models没同步,可能会存在问题,因此开始我的百度之旅(这个问题网上资料还真的挺少的)
方法一,不要犹豫,重启大法,关闭项目,关闭开发工具,从新打开,这个方法好像不行
方法二,删除大法,因为django有models在,数据库建表还是很容易的,只不过是数据丢失了,对我我这种不正经的开发来说,无关紧要咯
所以,我删除了库,删除了django生成的migrations(画重点),
然后重新建表,迁移,结果makemigrations,提示“No changes detected”,
问题就在这里,不能删除migrations文件夹,这个文件夹是要存放models的修改记录的,如果删除了,可以用python manage.py makemigrations --empty booktest 重新生成,然后在迁移
django 修改字段后,同步数据库,失败:django.db.utils.InternalError: (1054, "Unknown column 'api_config.project_id_id' in 'field list'")的更多相关文章
- 迁移文件是报错 django.db.utils.InternalError: (1054, "Unknown column 'name' in 'django_content_type'")
相信大家在做django迁移时有可能会遇到这样的错误- django.db.utils.InternalError: (1054, “Unknown column ‘name’ in ‘django_ ...
- django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法
django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法 django.db ...
- 解决django.db.utils.InternalError: (1049, "Unknown database 'exam_db'")
先检查seeting数据库配置DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'eaxm_db', ' ...
- django更换数据库时提示"django.db.utils.InternalError: (1366, "Incorrect string value: '\\xE7\\x94\\xA8\\xE6\\x88\\xB7' for column 'name' at row 1")"
问题提出 昨天在运行django时,初始化使用的是自带的数据库,后来更换mysql数据库,数据库同步之后,打开mysql无法添加数据,插入数据时,提示django.db.utils.InternalE ...
- 【BUG】插入或者更新超过限制后写入数据库失败
Error Code: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your ...
- django.db.utils.InternalError: (1091, "Can't DROP 'cre_time'; check that column/key exists")
在执行命令python manage.py migrate时报错:django.db.utils.InternalError: (1091, “Can’t DROP ‘cre_time’; check ...
- django 连接MYSQL时,数据迁移时报:django.db.utils.InternalError: (1366, "Incorrect string value: '\\xE9\\x97\\xAE\\xE9\\xA2\\x98' for column 'name' at row 5")
django 连接MYSQL时,数据迁移时报:django.db.utils.InternalError: (1366, "Incorrect string value: '\\xE9\\x ...
- mysql修改字段长度及pymysql.err.DataError: (1406, "Data too long for column 'name' at row 1")错误
文章链接:修改字段:https://blog.csdn.net/xiejunna/article/details/78580682 错误分析:https://blog.csdn.net/qq_4214 ...
- Error Code: 1054. Unknown column '字段名' in 'field list'
问题描述: j博主在java开发过程中,通过读取excel中表名和字段名,动态创建insert的SQL语句,在mysql可视化工具中执行此SQL语句时,一直提示"Error Code: 10 ...
随机推荐
- Linux内核调试方法总结之ddebug
[用途] Linux内核动态调试特性,适用于驱动和内核各子系统调试.动态调试的主要功能就是允许你动态的打开或者关闭内核代码中的各种提示信息.适用于驱动和内核线程功能调试. [使用方法] 依赖于CONF ...
- URL里的分号';'一定要编码为%3b!!!!
http://en.wikipedia.org/wiki/Query_string The series of pairs is separated by the ampersand, '&' ...
- C++ STL 二分查找
转载自 https://www.cnblogs.com/Tang-tangt/p/9291018.html 二分查找的函数有 3 个: 参考:C++ lower_bound 和upper_bound ...
- CyclicBarrier 源码分析
CyclicBarrier CyclicBarrier 是一个同步辅助类,它允许一组线程互相等待,直到到达某个公共屏障点 (common barrier point) 之后同时释放执行.CyclicB ...
- 架构-层-BLL:BLL
ylbtech-架构-层-BLL:BLL 业务逻辑层(Business Logic Layer)无疑是系统架构中体现核心价值的部分.它的关注点主要集中在业务规则的制定.业务流程的实现等与业务需求有关的 ...
- MySQL-default设置
Both statements insert a value into the phone column, but the first inserts a NULL value and the sec ...
- scrapy-splash常用设置
# Splash服务器地址 SPLASH_URL = 'http://localhost:8050' # 开启Splash的两个下载中间件并调整HttpCompressionMiddleware的次序 ...
- ssh连接MAC服务器显示No route to host解决方法
首先MAC操作系统是10 其它电脑通过ssh访问一台mac服务器时,有时候可以登录进去,有显示显示no route to host 并且通过浏览器访问布署在mac上的jenkins,反应奇慢,后来做了 ...
- java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider解决方法
因为加入了jdk的第三方安全库,需要额外配置 1.下载bcprov-jdkxx-xxx.jar 2.将bcprov-jdkxx-xxx.jar放入$JAVA_HOME/jre/lib/ext下 3.打 ...
- 006-Spring Boot自动配置-Condition、Conditional、Spring提供的Conditional自动配置
一.接口Condition.Conditional(原理) 主要提供一下方法 boolean matches(ConditionContext context, AnnotatedTypeMetada ...