[Django] #33201: RenameModel with db_table recreate constraints.

7 views
Skip to first unread message

Django

unread,
Oct 16, 2021, 5:30:17 AM10/16/21
to django-...@googlegroups.com
#33201: RenameModel with db_table recreate constraints.
------------------------------------------+------------------------
Reporter: Iuri de Silvio | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
A RenameModel operation that already has db_table defined must be a noop.

In Postgres, it drops and recreates foreign key constraints. In sqlite it
recreates the table (as expected for a table renaming).

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

Django

unread,
Oct 16, 2021, 5:32:31 AM10/16/21
to django-...@googlegroups.com
#33201: RenameModel with db_table recreate constraints.
--------------------------------+------------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de Silvio
Type: Bug | Status: assigned
Component: Migrations | Version: 3.2
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 Iuri de Silvio):

* owner: nobody => Iuri de Silvio
* status: new => assigned


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

Django

unread,
Oct 16, 2021, 6:09:24 AM10/16/21
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 3.2
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 Mariusz Felisiak):

* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/14999 PR]

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

Django

unread,
Oct 22, 2021, 10:39:47 AM10/22/21
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 3.2

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 Iuri de Silvio):

I fixed the patch and it is waiting for review.

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

Django

unread,
Oct 27, 2021, 6:42:23 AM10/27/21
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


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

Django

unread,
Oct 27, 2021, 7:36:53 AM10/27/21
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: closed
Component: Migrations | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"afeafd6036616bac8263d762c1610f22241c0187" afeafd60]:
{{{
#!CommitTicketReference repository=""
revision="afeafd6036616bac8263d762c1610f22241c0187"
Fixed #33201 -- Made RenameModel operation a noop for models with
db_table.
}}}

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

Django

unread,
Aug 26, 2022, 1:14:58 AM8/26/22
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: closed
Component: Migrations | Version: 3.2

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"166a3b32632c141541d1c3f0eff18e1d8b389404" 166a3b32]:
{{{
#!CommitTicketReference repository=""
revision="166a3b32632c141541d1c3f0eff18e1d8b389404"
Fixed #33953 -- Reverted "Fixed #33201 -- Made RenameModel operation a


noop for models with db_table."

Regression in afeafd6036616bac8263d762c1610f22241c0187.
This reverts afeafd6036616bac8263d762c1610f22241c0187.

Thanks Timothy Thomas for the report.
}}}

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

Django

unread,
Aug 26, 2022, 1:15:23 AM8/26/22
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: closed
Component: Migrations | Version: 3.2

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"7d5ccbbe1a3ad99b02c25f1ce90f36334d881ab6" 7d5ccbbe]:
{{{
#!CommitTicketReference repository=""
revision="7d5ccbbe1a3ad99b02c25f1ce90f36334d881ab6"
[4.1.x] Fixed #33953 -- Reverted "Fixed #33201 -- Made RenameModel


operation a noop for models with db_table."

Regression in afeafd6036616bac8263d762c1610f22241c0187.
This reverts afeafd6036616bac8263d762c1610f22241c0187.

Thanks Timothy Thomas for the report.

Backport of 166a3b32632c141541d1c3f0eff18e1d8b389404 from main
}}}

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

Django

unread,
Aug 26, 2022, 1:18:12 AM8/26/22
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: closed
Component: Migrations | Version: 3.2
Severity: Normal | Resolution: wontfix

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 Mariusz Felisiak):

* has_patch: 1 => 0
* resolution: fixed => wontfix
* stage: Ready for checkin => Unreviewed


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

Django

unread,
Jul 18, 2023, 8:09:01 AM7/18/23
to django-...@googlegroups.com
#33201: RenameModel with db_table should be a noop.
-------------------------------------+-------------------------------------
Reporter: Iuri de Silvio | Owner: Iuri de
Type: | Silvio
Cleanup/optimization | Status: closed
Component: Migrations | Version: 3.2
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"3109038992321e471944bd8ee36670c9e6b8ff0c" 31090389]:
{{{
#!CommitTicketReference repository=""
revision="3109038992321e471944bd8ee36670c9e6b8ff0c"
Refs #33201 -- Avoided unnecessary queries when renaming models with
db_table on SpatiaLite.
}}}

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

Reply all
Reply to author
Forward
0 new messages