Closed ataft closed 7 years ago
The same is also true of the queryExportedForeignKeys function. fkTableName is the same as pkTableName on SQL Server 2016
Is there any update on this bug? Foreign keys are the only absolute way to know a relationship exists between two entities. Isn't this crucial to discovery?
Never mind, I wrote the correct query and created a pull request (https://github.com/strongloop/loopback-connector-mssql/pull/155) for this fix.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS
file at the top-level of this repository.
The ds.discoverForeignKeys function, which uses queryForeignKeys from discovery.js, returns the pkTableName as both pkTableName and fkTableName on SQL Server 2016. The following query should return the correct results for fkTableName:
Here's the corresponding DDL that shows the foreign key constraint: