-
Notifications
You must be signed in to change notification settings - Fork 227
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
Synonym foreign keys and stored procedures #359
Synonym foreign keys and stored procedures #359
Conversation
Thanks Tim, much appreciated! |
Bug introduced duplicate FK's which caused one-to-one to become one-to-may.
Released in v2.35.0 |
@TimSirmovics I've corrected a slight bug in the SQL. I had to change "UNION ALL" to "UNION" to remove duplicates. The duplicates were causing the code to generate many-to-may FK relationships instead of one-to-one in certain circumstances. |
@sjh37 @TimSirmovics Hi guys. The database I am working has four tables, each setup like this: In the tt file, I filter out everything but the synonym Table1. The output does not have navigation properties. I used SQL Profiler to obtain the SQL generated by Ef.Reverse.Poco.Core.ttinclude This is the first statement with a resultset. It begins on line 230 of Profiler's output. ' Later on, the #SynonymFkDetails table is populated. I noticed it contains all the FKs in the database, but there doesn't seem to be anything to match them with Synonyms. |
Hi @dialedin2014, I think you are correct in that the synonyms foreign keys do not work properly if the synonym and original table do not have the same name. If you could submit a PR to fix this that would be great, otherwise I will try and look at it when I have time. |
Added support and test cases for foreign key navigation properties (#110) and stored procedures when referencing objects through synonyms.