12 lines
1.2 KiB
Markdown
Executable File
12 lines
1.2 KiB
Markdown
Executable File
**EF Core Migration**
|
||
**手动命令行的方式**
|
||
Update-Database -Verbose -c safeMonitorDbContext
|
||
|
||
| | | |
|
||
| ------------------------------------------- | --------------------------------- | ------------------------------- |
|
||
| VSCode | VS2017 | 说明 |
|
||
| dotnet ef migrations add InitialCreate | Add-Migration | 对当前EF实体模型增加一个配置文件 |
|
||
| dotnet ef database update | Update-Database | 对当前版本进行更新 |
|
||
| dotnet ef migrations remove | Remove-Migration | 删除最新的Migration |
|
||
| dotnet ef database update LastGoodMigration | Update-Database LastGoodMigration | 对指定版本进行更新 |
|
||
| dotnet ef migrations script | Script-Migration | 对当前更新生成一个sql的脚本,我们可以使用脚本到数据库取执行 | |