[Django] #30800: Altering field crashes for fields with custom db_type() on PostgreSQL.

4 views
Skip to first unread message

Django

unread,
Sep 25, 2019, 2:30:02 AM9/25/19
to django-...@googlegroups.com
#30800: Altering field crashes for fields with custom db_type() on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: assigned
Component: Database | Version: 3.0
layer (models, ORM) |
Severity: Release | Keywords:
blocker |
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Altering field crashes for fields with a custom `db_type()` on PostgreSQL,
e.g. `ArrayField`:
{{{
def db_type(self, connection):
size = self.size or ''
return '%s[%s]' % (self.base_field.db_type(connection), size)
}}}

Regression in 1378d665a1c85897d951f2ca9618b848fdbba2e7.

{{{
File "django/django/db/backends/postgresql/schema.py", line 72, in
_alter_column_type_sql
if self._field_data_type(old_field) !=
self._field_data_type(new_field):
File "django/django/db/backends/postgresql/schema.py", line 45, in
_field_data_type
return self.connection.data_types[field.get_internal_type()]
KeyError: 'ArrayField'
}}}

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

Django

unread,
Sep 25, 2019, 2:44:05 AM9/25/19
to django-...@googlegroups.com
#30800: Altering field crashes for fields with custom db_type() on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | 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 felixxm):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Sep 25, 2019, 6:33:15 AM9/25/19
to django-...@googlegroups.com
#30800: Altering field crashes for fields with custom db_type() on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: closed

Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
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 GitHub <noreply@…>):

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


Comment:

In [changeset:"580e644f24f1c5ae5b94784fb73a9953a178fd26" 580e644f]:
{{{
#!CommitTicketReference repository=""
revision="580e644f24f1c5ae5b94784fb73a9953a178fd26"
Fixed #30800 -- Fixed migrations crash when altering a field with custom
db_type().

Regression in 1378d665a1c85897d951f2ca9618b848fdbba2e7.
}}}

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

Django

unread,
Sep 25, 2019, 6:34:58 AM9/25/19
to django-...@googlegroups.com
#30800: Altering field crashes for fields with custom db_type() on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: closed
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
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 Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"1adf85d1687587b777f361f7831ebc0392f7127f" 1adf85d1]:
{{{
#!CommitTicketReference repository=""
revision="1adf85d1687587b777f361f7831ebc0392f7127f"
[3.0.x] Fixed #30800 -- Fixed migrations crash when altering a field with
custom db_type().

Regression in 1378d665a1c85897d951f2ca9618b848fdbba2e7.
Backport of 580e644f24f1c5ae5b94784fb73a9953a178fd26 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages