refactor: removed nullable in models

This commit is contained in:
2025-10-11 10:34:05 +04:00
parent bd4f4138be
commit fbb0c72bce
7 changed files with 14 additions and 26 deletions

View File

@ -1,4 +1,3 @@
from datetime import datetime
from typing import Optional, TYPE_CHECKING
from sqlalchemy import ForeignKey
@ -16,10 +15,7 @@ class Client(BaseModel, IdMixin, CreatedAtMixin, SoftDeleteMixin):
name: Mapped[str] = mapped_column(unique=True, comment="Название клиента")
company_name: Mapped[str] = mapped_column(
nullable=False,
comment="Название компании",
)
company_name: Mapped[str] = mapped_column(comment="Название компании")
products: Mapped[list["Product"]] = relationship(
back_populates="client", lazy="noload"

View File

@ -62,4 +62,4 @@ class ProductImage(BaseModel, IdMixin):
product_id: Mapped[int] = mapped_column(ForeignKey("fulfillment_base_products.id"))
product: Mapped["Product"] = relationship(back_populates="images")
image_url: Mapped[str] = mapped_column(nullable=False)
image_url: Mapped[str] = mapped_column()