Re: [sqlalchemy] Foriegn key from one database to another in SQLAlchemy or Alembic

2021-03-14 Thread Mike Bayer
When you want to have objects in different databases in the same server have SQL interactions, you use one engine and then schema-qualify the tables using the "schema" argument: https://docs.sqlalchemy.org/en/14/core/metadata.html#specifying-the-schema-name if OTOH you are talking about two e

[sqlalchemy] Foriegn key from one database to another in SQLAlchemy or Alembic

2021-03-14 Thread ai.rese...@gmail.com
Hi all, I highly appreciate your help with the following issue. I have two different databases in MySQL let say db1 and db2. I want to add a foreign key constraint from table db1.tablex to table db2.tabley and also include the corresponding relationship in the declarative mapping. I have to c