-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Insert fails when model has tables with same name in different schemas #30087
Comments
@Alexander-Leontiev can you please try the latest 8.0 daily build? There have been several fixes around this area for 7.0.2 and 7.0.3, testing the daily build would tell us whether your issue is a dup of one of those. |
@roji 7.0.2 still has the issue. 7.0.3 failed to be restored. |
If 7.0.0 fixed the issue, then 7.0.3 already contained the fix - all the fixes in this area have already been backported. |
@roji sounds great! When 7.0.3 public release is expected? |
Not long - in mid-February. |
Duplicate of #29741 😉 |
I'm in progress of updating EF Core to version 7 from 3.
In my DB model I have some tables, which have same names but different schemas. My current EF Core 3.1.15 copes well with it.
However EF Core 7.0.1 fails to handle it. If I try to save new entities for different schemas at once, EF generates wrong queries with negative values for FK columns.
My model looks like the following:
When I try to save new User with Settings properties been initialized, EF generates queries like:
As you can see, instead of using generated PK value from parent table EF tries to insert some synthetic negative values into FK columns of child tables.
Project to reproduce the issue: EfTest.zip
EF Core version: 7.0.1
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: net6.0
The text was updated successfully, but these errors were encountered: