mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #31351 -- Made partial constraints tests use required_db_features.
This will notably silence the warnings issued when running the test suite on MySQL and MariaDB.
This commit is contained in:
@@ -41,6 +41,16 @@ class UniqueConstraintProduct(models.Model):
|
||||
class Meta:
|
||||
constraints = [
|
||||
models.UniqueConstraint(fields=['name', 'color'], name='name_color_uniq'),
|
||||
]
|
||||
|
||||
|
||||
class UniqueConstraintConditionProduct(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
color = models.CharField(max_length=32, null=True)
|
||||
|
||||
class Meta:
|
||||
required_db_features = {'supports_partial_indexes'}
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=['name'],
|
||||
name='name_without_color_uniq',
|
||||
|
||||
Reference in New Issue
Block a user