Miq*_*uel 6 python django transactions django-south
我在申请django南迁时遇到了麻烦:
与往常一样,我在成功进行模式迁移后执行了migrate命令
python manage.py migrate webapp
Run Code Online (Sandbox Code Playgroud)
日志控制台:
Running migrations for webapp:
- Migrating forwards to 0020_auto__add_example.
> webapp:0020_auto__add_example
TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
Run Code Online (Sandbox Code Playgroud)
该错误与特定迁移无关,就好像我向后移动并尝试另一个它显示相同的消息.
编辑.这是查询的日志:
(0.005) SELECT `south_migrationhistory`.`id`, `south_migrationhistory`.`app_name`, `south_migrationhistory`.`migration`, `south_migrationhistory`.`applied` FROM `south_migrationhistory` WHERE `south_migrationhistory`.`applied` IS NOT NULL ORDER BY `south_migrationhistory`.`applied` ASC; args=()
Running migrations for webapp:
- Migrating forwards to 0020_auto__add_example.
> webapp:0020_auto__add_example
(0.002) CREATE TABLE ROLLBACK_TEST (X INT); args=()
TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
Run Code Online (Sandbox Code Playgroud)
小智 15
我刚遇到类似的问题.
我在这里经历了几乎所有可能的修复,并通过无数的谷歌搜索,运气不佳.
我查看了数据库模式,我没有创建名为'ROLLBACK_TEST'的表是模式的一部分.
一旦我放下那张神秘的桌子,迁移就完美无缺.
该表只能通过Django,South或可能是亚马逊的内部流程发起,因为没有其他任何人可以访问.
我正在写我遇到的问题的答案,因为它可能对某人有用。
经过一段时间的调试,我发现问题与django无关。这是数据库和托管该数据库的虚拟机的问题。
我重新启动了数据库计算机,迁移现在正在运行。