SQLAlchemy 2.0 foreign key across parent and child tables Say I have these tables which define hierarchy