-
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
Defaults cannot be created on columns with an IDENTITY attribute. #5660
Comments
@Zoltu we believe this issue was already fixed after RC2. Could you check with nightly builds? @AndriySvyryd did you fix this one? Could you please find the original bug and close this as a dupe? (I couldn't). |
Possible work-around... Adding ".ValueGeneratedNever()" to the fluent API configuration for the field seems to prevent EF from adding the IdentityColumn annotation. |
@AndriySvyryd friendly ping... I am not sure what change would have fixed this. |
I get this exception yet in EF Core 1.0 Defaults cannot be created on columns with an IDENTITY attribute. Table 'Languages', column 'ID'.
|
Steps to reproduce
[Key]
column and create/apply an initial migration.[DatabaseGenerated(DatabaseGeneratedOption.Identity)] public Int64 SecondaryId { get; set; }
defaultValue: 0L
.Defaults cannot be created on columns with an IDENTITY attribute.
The issue
I expect that creating a migration will create a valid migration, rather than generating a migration that can't be executed.
If you are seeing an exception, include the full exceptions details (message and stack trace).
Further technical details
EF Core version:
1.0.0-rc2-final
Operating system:
Windows 10
Visual Studio version:
2015
Other details about my project setup:
EntityFrameworkCore.Tools
1.0.0-preview1-final
Azure SQL Server for the backend.
The text was updated successfully, but these errors were encountered: