feat: add agreements foundation
This commit is contained in:
+2
-1
@@ -10,7 +10,7 @@ class BoqDocument(Base):
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
project_id = Column(Integer, ForeignKey("projects.id"), nullable=False)
|
||||
agreement_id = Column(Integer) # nullable
|
||||
agreement_id = Column(Integer, ForeignKey("agreements.id"), nullable=True, index=True)
|
||||
name = Column(String, nullable=False)
|
||||
version = Column(String)
|
||||
source_file = Column(String)
|
||||
@@ -18,6 +18,7 @@ class BoqDocument(Base):
|
||||
|
||||
# Relationship to project
|
||||
project = relationship("Project", back_populates="boq_documents")
|
||||
agreement = relationship("Agreement", back_populates="boq_documents", foreign_keys=[agreement_id])
|
||||
|
||||
def __repr__(self):
|
||||
return f"<BoqDocument(id={self.id}, name='{self.name}')>"
|
||||
|
||||
Reference in New Issue
Block a user