mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Fixed #30913 -- Added support for covering indexes on PostgreSQL 11+.
This commit is contained in:
parent
f997b5e6ae
commit
8c7992f658
20 changed files with 719 additions and 41 deletions
|
@ -81,6 +81,23 @@ class UniqueConstraintDeferrable(models.Model):
|
|||
]
|
||||
|
||||
|
||||
class UniqueConstraintInclude(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
color = models.CharField(max_length=32, null=True)
|
||||
|
||||
class Meta:
|
||||
required_db_features = {
|
||||
'supports_table_check_constraints',
|
||||
}
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=['name'],
|
||||
name='name_include_color_uniq',
|
||||
include=['color'],
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class AbstractModel(models.Model):
|
||||
age = models.IntegerField()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue