#28964 closed Bug (duplicate)
RenameField after AddField after CreateModel in one operations list gives ProgrammingError: relation "field" does not exist
Reported by: | Matthew Pava | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In one migration file, I have this series of operations:
migrations.CreateModel(m, fields=[a, b, c]) migrations.AddField(m, x) migrations.RenameField(x, y)
I get this:
ProgrammingError: column "x_id" does not exist.
I workaround it by replacing x with y in the AddField
operation and then removing the RenameField
operation.
Change History (5)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Not at the moment with my particular project, though I have tried. (I'm waiting for a 3rd-party package to get Django 2.0 support.) I will continue trying tomorrow, but I will state that I'm getting different results than with Django 1.11. There are still some bugs I'm seeing, but I haven't determined conclusively if they are related to the migrations.
comment:3 by , 7 years ago
If you get the ProgrammingError
during index or foreign key constraint creation than I'm fairly confident this is a duplicate of #25530 which is fixed in Django 2.0.
Can you test with Django 2.0?