16 lines
646 B
Python
16 lines
646 B
Python
"""Acces aux modules par poste."""
|
|
import uuid
|
|
from datetime import datetime, timezone
|
|
from sqlalchemy import DateTime, ForeignKey, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from app.core.database import Base
|
|
|
|
|
|
class PosteModule(Base):
|
|
__tablename__ = "postes_modules"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid.uuid4)
|
|
poste_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("postes.id"), nullable=False)
|
|
module_code: Mapped[str] = mapped_column(String(20), nullable=False)
|
|
cree_le: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
|
|
|