42-EF Core Migration

1-常用命令

1-由于2.1版本有点不一样,不会自动创建ApplicationUser类,发现合并没效果。暂时略

增加一个字段

E:\coding\netcore\IdentitySample>dotnet ef migrations add NewColumn

更新到数据库中

E:\coding\netcore\IdentitySample>dotnet ef database update

3.1-还原到指定migriations,首先删除还原数据字段

E:\coding\netcore\IdentitySample>dotnet ef database  update AddColumn

3.2-再利用 remove移动多余的属性

E:\coding\netcore\IdentitySample>dotnet ef migrations remove

生成脚本

E:\coding\netcore\IdentitySample>dotnet ef migrations script

猜你喜欢

转载自www.cnblogs.com/qinzb/p/9380242.html
今日推荐