- changed milestone to 0.5.xx
MySQL Reflection: Support for inter-database Foreign Keys
Hello everyone,
I haven't worked with MSSQL yet, but I guess this ticket somehow relates to #1341 and #594:
In MySQL you can have Foreign Keys referencing tables of a different database on the same database server. When using reflection, those inter-database FK constraints are being ignored, as they do not match the appropriate constraint regular expression.
I might not grasp every aspect of such inter-database constraints in SA yet, but a change to this regular expression seems to suffice in order for relations to be set up correctly between mapped objects of different databases without specifying primaryjoin arguments or overloading column definitions (to include self-made ForeignKey constraints) on reflected tables.
I have attached a diff to databases/mysql.py.
Best Regards, Thomas Wiebe
Comments (4)
-
repo owner -
repo owner I'm kind of amazed we don't have tests for this ? tests will need to be added to tests/dialect/mysql.py resembling those of test/dialect/postgres.py test_schema_reflection.
-
repo owner - changed milestone to 1.x.xx
-
repo owner - changed status to resolved
This issue was fixed over six years ago (!) in ab0434d6488772b927c393773 and the issue here never got closed.
- Log in to comment