修改了數(shù)據(jù)庫(kù)表名之后,更新數(shù)據(jù)庫(kù)時(shí)跳錯(cuò):
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 數(shù)據(jù)庫(kù)不支持重命名的操作,添加atomic = False即可:
Migration 在 \py36\Lib\site-packages\django\db\migrations\migration.py 的位置文章來源:http://www.zghlxwxcb.cn/news/detail-691360.html
將 atomic = True 改成 atomic = False文章來源地址http://www.zghlxwxcb.cn/news/detail-691360.html
到了這里,關(guān)于【Django】讓SQLite數(shù)據(jù)庫(kù)中表名支持重命名的方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!