


.net core 数据库迁移可以参考:https://www.tnblog.net/aojiancc2/article/details/5370
可以使用get-help命令查看命令的详情
get-help Add-Migration -detailed
get-help Update-Database -detailed
Add-Migration
语法
Add-Migration [-Name] <String> [-OutputDir <String>] [-Context <String>] [-Project <String>] [-StartupProject <String>] [<CommonParameters>]
说明
Adds a new migration.
参数
-Name <String>
The name of the migration.
-OutputDir <String>
The directory (and sub-namespace) to use. Paths are relative to the project directory. Defaults to "Migrations".
-Context <String>
The DbContext type to use.
-Project <String>
The project to use.
-StartupProject <String>
The startup project to use. Defaults to the solution's startup project.
<CommonParameters>
此 Cmdlet 支持通用参数: Verbose、Debug、
ErrorAction、ErrorVariable、WarningAction、WarningVariable、
OutBuffer 和 OutVariable。有关详细信息,请参阅
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)。
备注
若要查看示例,请键入: "get-help Add-Migration -examples".
有关详细信息,请键入: "get-help Add-Migration -detailed".
若要获取技术信息,请键入: "get-help Add-Migration -full".
有关在线帮助,请键入: "get-help Add-Migration -online"
摘要
Updates the database to a specified migration.
语法
Update-Database [[-Migration] <String>] [-Context <String>] [-Project <String>] [-StartupProject <String>] [<CommonParameters>]
Update-Database
说明
Updates the database to a specified migration.
参数
-Migration <String>
The target migration. If '0', all migrations will be reverted. Defaults to the last migration.
-Context <String>
The DbContext to use.
-Project <String>
The project to use.
-StartupProject <String>
The startup project to use. Defaults to the solution's startup project.
<CommonParameters>
此 Cmdlet 支持通用参数: Verbose、Debug、
ErrorAction、ErrorVariable、WarningAction、WarningVariable、
OutBuffer 和 OutVariable。有关详细信息,请参阅
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)。
备注
若要查看示例,请键入: "get-help Update-Database -examples".
有关详细信息,请键入: "get-help Update-Database -detailed".
若要获取技术信息,请键入: "get-help Update-Database -full".
有关在线帮助,请键入: "get-help Update-Database -online"
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)