Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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 Tim Graham, 7 years ago

Can you test with Django 2.0?

comment:2 by Matthew Pava, 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.

Version 0, edited 7 years ago by Matthew Pava (next)

comment:3 by Simon Charette, 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.

comment:4 by Tim Graham, 7 years ago

Resolution: duplicate
Status: newclosed

Please reopen, if needed.

comment:5 by Matthew Pava, 7 years ago

For clarification purposes, this bug has been fixed in Django 2.0.

Note: See TracTickets for help on using tickets.
Back to Top