我在2018年4月13日合并了两张桌子。
Migrations for 'caseAT':
caseAT/migrations/0004_auto_20180413_1802.py
- Remove field case_ptr from papoose
- Add field lead to case
- Add field neighbor1 to case
- Add field neighbor2 to case
- Add field page_to_paragraph to case
- Add field pagerange_int_range to case
- Add field paranum_array to case
- Add field quills to case
- Add field root to case
- Delete model Papoose
(aishah) malikarumi@Tetuoan2:~/Projects/aishah/jamf35$ git commit -m 'just adding the migration I just did for the streamlined/consolidated case papoose merge.'
[post_repair_diff_and_align a3fbb69] just adding the migration I just did for the streamlined/consolidated case papoose merge.
1 file changed, 69 insertions(+)
create mode 100644 caseAT/migrations/0004_auto_20180413_1802.py
然后我从这个项目中休息了一下其他的东西。今天,当我回到这个项目时,我收到了一个错误,并且发现虽然我的迁移文件和我的模型与我预期的一样,但数据库却没有。我跑了showmigrations,这个特殊的,0004_auto_20180413_1802.py,没有在框中检查。我运行了makemigrations并得到了#34;未检测到任何变化"但当我运行runserver时,我得到了:
You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): caseAT.
Run 'python manage.py migrate' to apply them.
所以当然我运行了迁移,并得到了这个错误:
django.db.utils.ProgrammingError: column "case_ptr_id" of relation "caseAT_papoose" does not exist
你会注意到这个专栏和整个表在4月13日被删除了.WTF正在进行中,我该如何解决?感谢。
ps:我知道orm的重点是不要在数据库中捣乱,但在这种情况下,我最好手动更改db表以匹配我的模型吗?