From e387f191f76777015b6ea687ce83cdb05ee47cee Mon Sep 17 00:00:00 2001 From: Tom Carrick Date: Sat, 18 Jul 2020 13:17:39 +0200 Subject: Fixed #31777 -- Added support for database collations to Char/TextFields. Thanks Simon Charette and Mariusz Felisiak for reviews. --- django/core/management/commands/inspectdb.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'django/core') diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py index 73e8a19e76..f9b4bfb477 100644 --- a/django/core/management/commands/inspectdb.py +++ b/django/core/management/commands/inspectdb.py @@ -247,6 +247,9 @@ class Command(BaseCommand): if field_type == 'CharField' and row.internal_size: field_params['max_length'] = int(row.internal_size) + if field_type in {'CharField', 'TextField'} and row.collation: + field_params['db_collation'] = row.collation + if field_type == 'DecimalField': if row.precision is None or row.scale is None: field_notes.append( -- cgit v1.3