Answer the question
In order to leave comments, you need to log in
How to add a foreign key to an existing table in SQLAlchemy?
There are such classes where several indicators (Indicator) belong to one report (Report):
class Report(Base):
__tablename__ = 'report'
id = Column(Integer, primary_key=True)
name = Column(String)
comment = Column(String)
regularity = Column(Integer)
theme = Column(Integer)
class Indicator(Base):
__tablename__ = 'indicator'
date = Column(String, primary_key=True)
value = Column(String)
report = Column(Integer, primary_key=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question