Guest User

Untitled

a guest
Jul 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. class Entity1(Base):
  2. __tablename__ = 'entity1' ## I tried combination of <db>.<table> with no success
  3. entity1_id = Column(Integer, primary_key=True)
  4. entity2_id = Column(Integer, ForeignKey('db2.entity2.entity2_id'))
  5. entity2 = relationship('Entity2')
  6.  
  7. class Entity2(Base):
  8. __tablename__ = 'entity2' ## I tried combination of <db>.<table> with no success
  9. entity2_id = Column(Integer, primary_key=True)
  10.  
  11. class Entity2(Base):
  12. __tablename__ = 'entity2' ## I tried combination of <db>.<table> with no success
  13. __table_args__ = {'schema': 'db2'}
  14. entity2_id = Column(Integer, primary_key=True)
  15.  
  16. class Entity1(Base):
  17. __tablename__ = 'entity1' ## I tried combination of <db>.<table> with no success
  18. __table_args__ = {'schema': 'db1'}
  19. entity1_id = Column(Integer, primary_key=True)
  20. entity2_id = Column(Integer, ForeignKey(Entity2.entity2_id))
  21. entity2 = relationship('Entity2')
Add Comment
Please, Sign In to add comment