【Django】让SQLite数据库中表名支持重命名的方法

修改了数据库表名之后,更新数据库时跳错:

html 复制代码
django.db.utils.NotSupportedError: Renaming the 'japi_api_info' table while in a transaction is not supported on SQLite < 3.26 because it would break referential integrity. Try adding `atomic = False` to the Migration cl
ass.

意思就是 SQLite 数据库不支持重命名的操作,添加atomic = False即可:

Migration 在 \py36\Lib\site-packages\django\db\migrations\migration.py 的位置

将 atomic = True 改成 atomic = False

相关推荐
heimeiyingwang3 小时前
企业供应链 AI 优化:需求预测与智能调度
大数据·数据库·人工智能·机器学习
山岚的运维笔记4 小时前
SQL Server笔记 -- 第73章:排序/对行进行排序
数据库·笔记·后端·sql·microsoft·sqlserver
XLYcmy4 小时前
智能体大赛 目录
数据库·ai·llm·prompt·agent·检索·万方
盟接之桥4 小时前
盟接之桥EDI软件:API数据采集模块深度解析,打造企业数据协同新引擎
java·运维·服务器·网络·数据库·人工智能·制造
百锦再5 小时前
Jenkins 全面精通指南:从入门到脚本大师
运维·后端·python·servlet·django·flask·jenkins
FYKJ_20105 小时前
springboot大学校园论坛管理系统--附源码42669
java·javascript·spring boot·python·spark·django·php
闲人编程6 小时前
内存数据库性能调优
数据库·redis·字符串·高并发·哈希·内存碎片
l1t6 小时前
DeepSeek总结的PostgreSQL 19新功能:第一部分
数据库·postgresql
青衫码上行8 小时前
高频 SQL 50题(基础版)| 查询 + 连接
数据库·sql·学习·mysql
Anastasiozzzz8 小时前
阿亮随手记:动态条件生成Bean
java·前端·数据库