I have a postgres database that looks something like this:
Table \"public.entities\"
Column | Type | M
It's not completely clear what exactly is causing the problem since you omitted the most important part -- code that throws that exception but if adding relationship properties to class PostModel throws that try to add foreign_keys parameter to relationship call as the following:
class PostModel(...):
# ...
subject1_id = Column(db.Column(db.BigInteger, db.ForeignKey(EntitiesModel.id), nullable=False)
subject2_id = Column(db.Column(db.BigInteger, db.ForeignKey(EntitiesModel.id), nullable=False)
subject1 = relationship(EntitiesModel, foreign_keys=subject1_id)
subject2 = relationship(EntitiesModel, foreign_keys=subject2_id)