[Django] #22248: Model renaming doesn't work backwards

31 views
Skip to first unread message

Django

unread,
Mar 11, 2014, 1:23:10 PM3/11/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
---------------------------------+--------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------
Because of the way ModelRename also triggers AlterField on the foreign
keys of other models, it doesn't work in reverse, as that way round the
foreign keys are repointed to the old model before it is re-created.

Since some backends (e.g. PostgreSQL) repoint constraints along with
renames, we need to make sure that no AlterField is triggered with a
rename and then have RenameModel deal with the FKs on MySQL (and perhaps
Oracle?)

--
Ticket URL: <https://code.djangoproject.com/ticket/22248>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 11, 2014, 1:23:29 PM3/11/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
---------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: assigned
Component: Migrations | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Changes (by andrewgodwin):

* status: new => assigned
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:1>

Django

unread,
Mar 20, 2014, 12:25:02 AM3/20/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by andrewgodwin):

* severity: Release blocker => Normal


Comment:

I'm marking model renames as irreversible for now in order to move this
away from release blocker status; there's other irreversible core
operations, and we can address this if we get time before the final.

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:2>

Django

unread,
Mar 20, 2014, 1:53:15 PM3/20/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by aaugustin):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:3>

Django

unread,
May 1, 2014, 1:36:08 PM5/1/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: assigned
Component: Migrations | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------

Comment (by timo):

There's a test in tests/migrations/test_operations.py
(test_rename_model_with_related) that should be uncommented when this is
fixed.

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:4>

Django

unread,
Jun 7, 2014, 9:18:34 PM6/7/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by Andrew Godwin <andrew@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"4ce7a6bc84c68406e39f48550434faeef3277eba"]:
{{{
#!CommitTicketReference repository=""
revision="4ce7a6bc84c68406e39f48550434faeef3277eba"
Fixed #22750, #22248: Model renaming now also alters field FKs
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:5>

Django

unread,
Jun 7, 2014, 9:18:49 PM6/7/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------

Comment (by Andrew Godwin <andrew@…>):

In [changeset:"b568bdf8da30fe5940a31add9f3a2b8029ecb04d"]:
{{{
#!CommitTicketReference repository=""
revision="b568bdf8da30fe5940a31add9f3a2b8029ecb04d"
[1.7.x] Fixed #22750, #22248: Model renaming now also alters field FKs
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:6>

Django

unread,
Nov 18, 2014, 7:31:43 AM11/18/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------

Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by stratoukos):

* cc: stratoukos (added)
* status: closed => new
* resolution: fixed =>


Comment:

Although this seems to be fixed by b568bdf, RenameModel.reversible is
still False making RenameModel unreversible.

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:7>

Django

unread,
Nov 18, 2014, 7:35:01 AM11/18/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------

Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by stratoukos):

* has_patch: 0 => 1
* stage: Accepted => Unreviewed


Comment:

I've made a pull request for this:
https://github.com/django/django/pull/3572.

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:8>

Django

unread,
Nov 18, 2014, 7:41:05 AM11/18/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------

Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by charettes):

* stage: Unreviewed => Accepted


Comment:

The '''Triage State''' refers to the ticket and not the patch.

Having '''Has patch''' checked with '''Patch needs improvement'''
unchecked will ensure your patch shows up in the review queue.

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:9>

Django

unread,
Nov 18, 2014, 8:40:26 AM11/18/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------

Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------

Comment (by stratoukos):

Sorry about that, this is my first code contribution to Django. I'll keep
it in mind for the future.

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:10>

Django

unread,
Nov 18, 2014, 10:14:29 AM11/18/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------

Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by MarkusH):

* cc: info+coding@… (added)
* needs_better_patch: 0 => 1
* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:11>

Django

unread,
Nov 19, 2014, 9:51:02 AM11/19/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by Stratos Moros <stratos@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"cf7a2a000e16b86dd721a021f1a2001529d8d707"]:
{{{
#!CommitTicketReference repository=""
revision="cf7a2a000e16b86dd721a021f1a2001529d8d707"
Fixed #22248 -- Made RenameModel reversible
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:12>

Django

unread,
Nov 19, 2014, 9:51:22 AM11/19/14
to django-...@googlegroups.com
#22248: Model renaming doesn't work backwards
------------------------------+----------------------------------------
Reporter: andrewgodwin | Owner: andrewgodwin
Type: Bug | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"50434aebe2d3307263ca55f6dd9fa7ace2f87d8f"]:
{{{
#!CommitTicketReference repository=""
revision="50434aebe2d3307263ca55f6dd9fa7ace2f87d8f"
[1.7.x] Fixed #22248 -- Made RenameModel reversible

Backport of cf7a2a000e from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22248#comment:13>

Reply all
Reply to author
Forward
0 new messages