Answer the question
In order to leave comments, you need to log in
Sqlalchemy AmbiguousForeignKeysError?
class User(Base):
__tablename__ = '_users'
id = Column(String(), primary_key=True)
firstname = Column(String(100))
lastname = Column(String(100))
reg_date = Column(DateTime(), server_default=text('CURRENT_TIMESTAMP'))
transactions = relationship('InnerTransaction')
class InnerTransaction(Base):
__tablename__ = '_transactions'
id = Column(Integer(), primary_key=True, autoincrement=False)
sender_id = Column(String(), ForeignKey('_users.id'))
receiver_id = Column(String(), ForeignKey('_users.id'))
amount = Column(String())
created_at = Column(DateTime(), server_default=text('CURRENT_TIMESTAMP'))
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