diff options
| author | Tom Carrick <tom@carrick.eu> | 2020-07-18 13:17:39 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-09-21 18:24:56 +0200 |
| commit | e387f191f76777015b6ea687ce83cdb05ee47cee (patch) | |
| tree | 003d83b5efda40fbfcdc1aa9302faca9578b1e30 /django/core | |
| parent | ba6b32e5efc4c813ba4432777b3b1743d4205d14 (diff) | |
Fixed #31777 -- Added support for database collations to Char/TextFields.
Thanks Simon Charette and Mariusz Felisiak for reviews.
Diffstat (limited to 'django/core')
| -rw-r--r-- | django/core/management/commands/inspectdb.py | 3 |
1 files changed, 3 insertions, 0 deletions
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( |
