16 lines
663 B
Python
16 lines
663 B
Python
"""Table options_sondage — Options de vote."""
|
|
import uuid
|
|
from sqlalchemy import String, Integer, ForeignKey
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
from app.core.database import Base
|
|
|
|
|
|
class OptionSondage(Base):
|
|
__tablename__ = "options_sondage"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid.uuid4)
|
|
sondage_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("sondages.id", ondelete="CASCADE"), nullable=False)
|
|
texte: Mapped[str] = mapped_column(String(200), nullable=False)
|
|
ordre: Mapped[int] = mapped_column(Integer, default=0)
|
|
|
|
sondage = relationship("Sondage", back_populates="options")
|