diff options
Diffstat (limited to 'django/db/backends/sqlite3/schema.py')
-rw-r--r-- | django/db/backends/sqlite3/schema.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py index 21e1b35fce..55fdf5fbfe 100644 --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -455,7 +455,11 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): # Alter by remaking table self._remake_table(model, alter_field=(old_field, new_field)) # Rebuild tables with FKs pointing to this field. - if new_field.unique and old_type != new_type: + old_collation = old_db_params.get("collation") + new_collation = new_db_params.get("collation") + if new_field.unique and ( + old_type != new_type or old_collation != new_collation + ): related_models = set() opts = new_field.model._meta for remote_field in opts.related_objects: |