#33932: Altering AutoFields with renaming a column crashes on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: Benoît Vinot Roseau | Owner: nobody
Technologies |
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Release blocker | 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 Mariusz Felisiak):
* cc: Florian Apolloner (added)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6. We should use the
new column name when dropping an identity:
{{{#!diff
diff --git a/django/db/backends/postgresql/schema.py
b/django/db/backends/postgresql/schema.py
index 633146a80b..cfc30516e6 100644
--- a/django/db/backends/postgresql/schema.py
+++ b/django/db/backends/postgresql/schema.py
@@ -175,7 +175,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
self.sql_drop_indentity
% {
"table": self.quote_name(table),
- "column":
self.quote_name(strip_quotes(old_field.column)),
+ "column":
self.quote_name(strip_quotes(new_field.column)),
}
)
column = strip_quotes(new_field.column)
}}}
Benoît, would you like to prepare a patch? (tests can be tricky.)
--
Ticket URL: <https://code.djangoproject.com/ticket/33932#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070182ab43ff4e-3b8943dd-90d8-481b-bda3-91763056d103-000000%40eu-central-1.amazonses.com.