feat: cascade deleting price rangecs

This commit is contained in:
2024-05-21 06:01:23 +03:00
parent ca6425021e
commit f874b41a07

View File

@@ -19,8 +19,11 @@ class Service(BaseModel):
nullable=False,
comment='Тип услуги')
price_ranges = relationship('ServicePriceRange', back_populates='service', lazy='selectin',
order_by="asc(ServicePriceRange.from_quantity)")
price_ranges = relationship('ServicePriceRange',
back_populates='service',
lazy='selectin',
order_by="asc(ServicePriceRange.from_quantity)",
cascade="all, delete-orphan")
class ServicePriceRange(BaseModel):