Ale*_*der 6 primary-key entity-framework-core entity-framework-migrations
我正在尝试通过实体框架核心迁移更改表的主键:
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Permissions",
table: "Permissions");
}
Run Code Online (Sandbox Code Playgroud)
当我尝试更新数据库时,我收到以下错误消息:
To change the IDENTITY property of a column, the column needs to be dropped and recreated.
Run Code Online (Sandbox Code Playgroud)
如何更新数据库?
我找到了解决方案:这似乎是 EF Core 1.1 中的一个错误
我更改了迁移文件。
有关此的更多信息可以在这里找到: https: //thisworksonmymachine.com/2017/02/13/ef-core-the-setup-part-4/
| 归档时间: |
|
| 查看次数: |
19690 次 |
| 最近记录: |