-
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
HasKey changed functionality in 2.1.1 Service Release #12414
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
punted-for-3.0
type-bug
Milestone
Comments
@danjohnso Thanks for reporting this. The fix in 2.1.1 that causes this issue can be reverted by setting the app switch "Microsoft.EntityFrameworkCore.Issue12119" to true as documented here: https://msdn.microsoft.com/en-us/library/system.appcontext.setswitch(v=vs.110).aspx |
AndriySvyryd
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Aug 28, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
punted-for-3.0
type-bug
When overriding calls to HasKey for an entity, the newest servicing release changes behavior and does not override previous calls to HasKey. The first call to HasKey is used to generate a Unique Constraint on the field, which looks to be broken as HasKey is supposed to be for defining a primary key (only one).
Using this example context in a brand new project:
The migration generated in 2.1.0 is:
In 2.1.1, the migration adds a unique constraint like it is applying both calls to HasKey and not overwriting the earlier call like it did before.
Further technical details
EF Core version: 2.1.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017 15.7.4
The text was updated successfully, but these errors were encountered: