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
Scaffolding not working with two or more foreign key to the same table #984
Comments
Your |
I think that's because the KSC_MACRO_DEVICE_RESERVE is bound a.) to the KSC_EVENT where it was created and b.) to one or many other KSC_EVENTs where it is used. |
If I understood that correctly, then you have a bug in your design. You'd need 2 columns for that to work. Because the FK does not know what "created" and "used" would be. It's just a link. |
There are two columns ID_EVENT and ID_EVENT_MACRO. |
But |
I issued that to my Database-Expert - and he admits you're right there is really something wrong! The second constrained must go to ID_EVENT_MACRO. |
Now it works. Sorry for the confusion! |
Hi,
I tried to scaffold a existing database from a Firebird 3.0 Server with the FirebirdSql.EntityFrameworkCore.Firebird 8.5.2 provider.
When importing the following table:
I get a "The foreign key {'ID_EVENT'} cannot be added to the entity type 'KSC_MACRO_DEVICE_RESERVE' because a foreign key on the same properties already exists on entity type 'KSC_MACRO_DEVICE_RESERVE' and also targets the key {'ID_EVENT'} on 'KSC_EVENT'." Error.
What can I do? I think there is a problem with the naming of more than 1 Key to the same table.
The text was updated successfully, but these errors were encountered: