mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #31777 -- Added support for database collations to Char/TextFields.
Thanks Simon Charette and Mariusz Felisiak for reviews.
This commit is contained in:
parent
ba6b32e5ef
commit
e387f191f7
25 changed files with 544 additions and 30 deletions
|
@ -1,4 +1,4 @@
|
|||
from django.db import models
|
||||
from django.db import connection, models
|
||||
|
||||
|
||||
class People(models.Model):
|
||||
|
@ -79,6 +79,23 @@ class JSONFieldColumnType(models.Model):
|
|||
}
|
||||
|
||||
|
||||
test_collation = connection.features.test_collations.get('non_default')
|
||||
|
||||
|
||||
class CharFieldDbCollation(models.Model):
|
||||
char_field = models.CharField(max_length=10, db_collation=test_collation)
|
||||
|
||||
class Meta:
|
||||
required_db_features = {'supports_collation_on_charfield'}
|
||||
|
||||
|
||||
class TextFieldDbCollation(models.Model):
|
||||
text_field = models.TextField(db_collation=test_collation)
|
||||
|
||||
class Meta:
|
||||
required_db_features = {'supports_collation_on_textfield'}
|
||||
|
||||
|
||||
class UniqueTogether(models.Model):
|
||||
field1 = models.IntegerField()
|
||||
field2 = models.CharField(max_length=10)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue