在最近从Oracle迁移到Postgres并从Django 1.2升级到1.3之后,我们在将对象保存到数据库时遇到了问题.当调用save()时,不返回id,即使通过标准django管理面板保存标准django auth模型,也会发生这种情况(即使用户已添加到db,也会返回'/ admin/auth/user/None /')并有一个id).
我们运行相同数据库的所有其他站点都没有这个问题,但是它们运行的是Django 1.1或1.2.
我们发现,对于迁移后创建的新表,它们的序列具有"拥有"属性,该属性由序列所在的列(通常是id列)拥有.改变'拥有'属性修复了我们在1.3中遇到的问题.
有人知道这个问题的根源是什么吗?我们已经找到了解决方案,如果其他人有这个问题,但我们很想知道是什么导致了这个问题.
$ py manage.py migrate turkey
Running migrations for turkey:
- Migrating forwards to 0001_initial.
> turkey:0001_initial
! Error found during real run of migration! Aborting.
! Since you have a database that does not support running
! schema-altering statements in transactions, we have had
! to leave it in an interim state between migrations.
! You *might* be able to recover with: = DROP TABLE `turkey_demorecs` CASCADE; []
! The South developers regret this has happened, and would
! like …Run Code Online (Sandbox Code Playgroud)