19 lines
654 B
Python
19 lines
654 B
Python
from sqlalchemy import Column, Integer, Float, String, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
from config.database import Base
|
|
|
|
|
|
class ProductionOutput(Base):
|
|
__tablename__ = "production_output"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
scenario_id = Column(Integer, ForeignKey("scenario.id"), nullable=False)
|
|
amount = Column(Float, nullable=False)
|
|
description = Column(String, nullable=True)
|
|
|
|
scenario = relationship(
|
|
"Scenario", back_populates="production_output_items")
|
|
|
|
def __repr__(self):
|
|
return f"<ProductionOutput id={self.id} scenario_id={self.scenario_id} amount={self.amount}>"
|