New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foreign key constraints not reflected from SQL Server Database #4234
Comments
Dave Hirschfeld wrote: Tested with sqlalchemy |
Dave Hirschfeld wrote: Tested against sqlalchemy In [2]: table2.foreign_keys
Out[2]: {ForeignKey('TEST2.TrueFalse.id')}
In [3]: table3.foreign_keys
Out[3]: {ForeignKey('TEST2.TrueFalse.id')}
In [4]: sa.__version__
Out[4]: '1.1.13' |
Dave Hirschfeld wrote: It appears it started failing from In [2]: table2.foreign_keys
Out[2]: {ForeignKey('TEST2.TrueFalse.id')}
In [3]: table3.foreign_keys
Out[3]: set()
In [4]: sa.__version__
Out[4]: '1.2.0' Issue #4060 seems a likely culprit? |
Michael Bayer (@zzzeek) wrote: you want to confirm on your end what im doing:
|
Michael Bayer (@zzzeek) wrote: the fix is simple https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/722 but the hard part is getting the test suite to open up inter-schema reflection tests beyond just postgresql so this may take a few passes. |
Michael Bayer (@zzzeek) wrote: Correct join for FKs with schema in SQL Server Fixed 1.2 regression caused by 🎫 Additionally, added some rework of the inter-schema reflection tests Fixes: #4234 → 9d5e117 |
Michael Bayer (@zzzeek) wrote: Correct join for FKs with schema in SQL Server Fixed 1.2 regression caused by 🎫 Additionally, added some rework of the inter-schema reflection tests Fixes: #4234 → 92310c1 |
Changes by Michael Bayer (@zzzeek):
|
Dave Hirschfeld wrote: Thanks for the quick response Mike! I can confirm that your one-line fix above appears to solve the problem for me 👍 |
Migrated issue, originally created by Dave Hirschfeld
Assuming a SQL Server database with two schemas
TEST1
andTEST2
the below MVCE demonstrates that the foreign key constraint isn't correctly reflected from the database:The FK constraint is created correctly in the database.
The text was updated successfully, but these errors were encountered: