Fixed #30913 -- Added support for covering indexes on PostgreSQL 11+.

This commit is contained in:
Hannes Ljungberg 2019-10-31 13:33:53 +01:00 committed by Mariusz Felisiak
parent f997b5e6ae
commit 8c7992f658
20 changed files with 719 additions and 41 deletions

View file

@ -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()