I am trying to Change the Primary key of a table via Entity Framework Core Migrations:
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Permissions",
table: "Permissions");
}
When I try to update the database I get the following error message:
To change the IDENTITY property of a column, the column needs to be dropped and recreated.
How can I update the database?
I have found a solution: This seems to be a bug in EF Core 1.1
I changed the Migration file.
More Information about this can be found here: https://thisworksonmymachine.com/2017/02/13/ef-core-the-setup-part-4/
On attempting to get IdentityServer4 EF migrations (SQLServer) I had this same problem. Updating Microsoft.EntityFrameworkCore to v2.1.3 and Microsoft.EntityFrameworkCore.Tools to v2.1.3 seemed to fix the issue.