-
Notifications
You must be signed in to change notification settings - Fork 228
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
IsRequired(false) created same field name with additional 1 #517
Comments
It seems reasonable for Regardless, this issue doesn't seem like it's specific to Npgsql in any way (it would probably happen in Sqlite, SQL Server...) so it belongs in the EF Core repo, if you're still encountering issues please move it there. |
/cc @divega @AndriySvyryd This is not unreasonable behavior, but I expected an exception instead that said the FK wasn't nullable, so just pinging you guys to take a look. |
@ajcvickers This is by design. The explicit 'IsRequired' overrides the FK property set through the attribute. |
@AndriySvyryd I think a warning might help other customers if not everyone. |
@divega it will also produce more log spam for customers that are ok with the behavior. |
I get that there is a compromise, but to me this one seems to be on the border of being invalid configuration. Do you think the chances that anyone would do this on purpose are high? I don't, but maybe I am missing something. |
It seems unlikely to me that this would be intentional, so a warning makes sense to me. |
Filed dotnet/efcore#12693 |
PostgresException: 42703: column t.Table1Id1 does not exist
The above code generated additional field that is invalid. Removing false in IsRequired() will operate normally. I am currently using Npgsql.EntityFrameworkCore.PostgreSQL v2.1.1.
The text was updated successfully, but these errors were encountered: