Добавлена миграция для CheckConstraint в OrderStatus
Проверка что статус не может быть одновременно позитивным и негативным концом
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 5.0.10 on 2026-01-05 14:00
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('orders', '0003_allow_null_delivery_date_for_drafts'),
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name='orderstatus',
|
||||||
|
constraint=models.CheckConstraint(check=models.Q(('is_positive_end', True), ('is_negative_end', True), _negated=True), name='not_both_positive_and_negative_end', violation_error_message='Статус не может быть одновременно положительным и отрицательным концом'),
|
||||||
|
),
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user