删除历史sql

This commit is contained in:
2024-09-11 09:22:32 +08:00
parent b9b095a19c
commit 14ec78a2fd
10 changed files with 4 additions and 1543 deletions
@@ -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