Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Entity1(Base):
- __tablename__ = 'entity1' ## I tried combination of <db>.<table> with no success
- entity1_id = Column(Integer, primary_key=True)
- entity2_id = Column(Integer, ForeignKey('db2.entity2.entity2_id'))
- entity2 = relationship('Entity2')
- class Entity2(Base):
- __tablename__ = 'entity2' ## I tried combination of <db>.<table> with no success
- entity2_id = Column(Integer, primary_key=True)
- class Entity2(Base):
- __tablename__ = 'entity2' ## I tried combination of <db>.<table> with no success
- __table_args__ = {'schema': 'db2'}
- entity2_id = Column(Integer, primary_key=True)
- class Entity1(Base):
- __tablename__ = 'entity1' ## I tried combination of <db>.<table> with no success
- __table_args__ = {'schema': 'db1'}
- entity1_id = Column(Integer, primary_key=True)
- entity2_id = Column(Integer, ForeignKey(Entity2.entity2_id))
- entity2 = relationship('Entity2')
Add Comment
Please, Sign In to add comment