mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #31815 -- Fixed schema value encoding on PostgreSQL.
This commit is contained in:
@@ -4,6 +4,7 @@ from django.db import models
|
||||
class Product(models.Model):
|
||||
price = models.IntegerField(null=True)
|
||||
discounted_price = models.IntegerField(null=True)
|
||||
unit = models.CharField(max_length=15, null=True)
|
||||
|
||||
class Meta:
|
||||
required_db_features = {
|
||||
@@ -31,6 +32,13 @@ class Product(models.Model):
|
||||
),
|
||||
name='%(app_label)s_price_neq_500_wrap',
|
||||
),
|
||||
models.CheckConstraint(
|
||||
check=models.Q(
|
||||
models.Q(unit__isnull=True) |
|
||||
models.Q(unit__in=['μg/mL', 'ng/mL'])
|
||||
),
|
||||
name='unicode_unit_list',
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user