修改了数据库表名之后,更新数据库时跳错:
django.db.utils.NotSupportedError: Renaming the ‘app_class‘ table while in a transaction is not supported on SQLite because it would break referential integrity. Try adding atomic = False to the Migration class.
意思就是 SQLite 数据库不支持重命名的操作,添加atomic = False即可:
Migration 在 py36Libsite-packagesdjangodbmigrationsmigration.py 的位置
将 atomic = True 改成 atomic = False
让SQLite数据库中表名支持重命名的方法
标签:util tom table int 就是 数据库表 The ror code
本文系统来源:https://www.cnblogs.com/JeromeLong/p/13195485.html
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!