删除历史sql
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
https://www.cnblogs.com/cqpanda/p/16815263.html
|
||||
|
||||
|
||||
# dotnet ef migrations add 签名名字 -p 项目名 -c 上下文名 -o 迁移文件生成目录
|
||||
# dotnet ef migrations add 本地迁移名字 -p 项目名 -c 数据库上下文名 -o 迁移文件生成目录
|
||||
|
||||
1、生成迁移文件
|
||||
dotnet ef migrations add Initial -p IRaCIS.Core.Test -c IRCContext -o CodeFirstTest/MSSQL/Migrations
|
||||
|
||||
2、撤销刚才生成的迁移文件
|
||||
2、撤销刚才生成的迁移文件(未更新到数据库的)
|
||||
dotnet ef migrations remove -p IRaCIS.Core.Test -c IRCContext
|
||||
|
||||
3、将迁移文件更新到数据库
|
||||
@@ -17,7 +17,7 @@ https://www.cnblogs.com/cqpanda/p/16815263.html
|
||||
4、查看已有迁移
|
||||
dotnet ef migrations list -p IRaCIS.Core.Test -c IRCContext
|
||||
|
||||
5、撤销某次更新到数据库的迁移
|
||||
5、撤销某次更新到数据库的迁移(自动执行down 方法)
|
||||
dotnet ef database update 某次迁移的前一次迁移名称 -p IRaCIS.Core.Test -c IRCContext
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user