You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
be-optimumoh/src/overhaul_job/model.py

20 lines
731 B
Python

from sqlalchemy import Column, DateTime, Float, Integer, String, UUID, ForeignKey
from src.database.core import Base
from src.models import DefaultMixin, IdentityMixin, TimeStampMixin
from sqlalchemy.orm import relationship
class OverhaulJob(Base, DefaultMixin):
__tablename__ = "oh_tr_overhaul_job"
overhaul_activity_id = Column(UUID(as_uuid=True), ForeignKey(
"oh_ms_overhaul_activity.id"), nullable=False)
job_id = Column(UUID(as_uuid=True), ForeignKey(
"oh_ms_job.id", ondelete="cascade"))
notes = Column(String, nullable=True)
status = Column(String, nullable=True, default="pending")
job = relationship(
"MasterActivity", lazy="raise", back_populates="overhaul_jobs"
)