mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #30800 -- Fixed migrations crash when altering a field with custom db_type().
Regression in 1378d665a1.
This commit is contained in:
@@ -42,7 +42,10 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||
def _field_data_type(self, field):
|
||||
if field.is_relation:
|
||||
return field.rel_db_type(self.connection)
|
||||
return self.connection.data_types[field.get_internal_type()]
|
||||
return self.connection.data_types.get(
|
||||
field.get_internal_type(),
|
||||
field.db_type(self.connection),
|
||||
)
|
||||
|
||||
def _create_like_index_sql(self, model, field):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user