fix: default option in attributes
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sqlalchemy import ForeignKey, UniqueConstraint
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from models.base import BaseModel
|
||||
@ -34,7 +33,6 @@ class AttributeSelect(BaseModel, IdMixin, SoftDeleteMixin):
|
||||
class AttributeOption(BaseModel, IdMixin, SoftDeleteMixin):
|
||||
__tablename__ = "attribute_options"
|
||||
|
||||
value: Mapped[dict[str, any]] = mapped_column(JSONB)
|
||||
label: Mapped[str] = mapped_column()
|
||||
|
||||
select_id: Mapped[int] = mapped_column(ForeignKey("attribute_selects.id"))
|
||||
@ -42,5 +40,3 @@ class AttributeOption(BaseModel, IdMixin, SoftDeleteMixin):
|
||||
back_populates="options",
|
||||
lazy="noload",
|
||||
)
|
||||
|
||||
__table_args__ = (UniqueConstraint("value", "select_id", name="_value_select_uc"),)
|
||||
|
||||
Reference in New Issue
Block a user