Many-to-many multi-database join with Flask-SQLAlchemy

谁说我不能喝 提交于 2019-12-04 05:29:45

Turns out what I needed to do here was specify the schema in my user_products_tbl table definition. So,

user_products_tbl = db.Table('user_products', db.metadata,
        db.Column('user_id', db.Integer, db.ForeignKey('users.user_id')),
        db.Column('product_id', db.Integer, db.ForeignKey('products.product_id')),
        schema='main_db'
)

Hope this helps someone else!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!