24 lines
648 B
Plaintext
24 lines
648 B
Plaintext
|
|
#参考学习文档
|
|
https://www.cnblogs.com/cqpanda/p/16815263.html
|
|
|
|
|
|
# dotnet ef migrations add 签名名字 -p 项目名 -c 上下文名 -o 迁移文件生成目录
|
|
|
|
1、生成迁移文件
|
|
dotnet ef migrations add Initial -p IRaCIS.Core.Test -c IRCContext -o CodeFirstTest/MSSQL/Migrations
|
|
|
|
2、撤销刚才生成的迁移文件
|
|
dotnet ef migrations remove -p IRaCIS.Core.Test -c IRCContext
|
|
|
|
3、将迁移文件更新到数据库
|
|
dotnet ef database update -p IRaCIS.Core.Test -c IRCContext
|
|
|
|
4、查看已有迁移
|
|
dotnet ef migrations list -p IRaCIS.Core.Test -c IRCContext
|
|
|
|
5、撤销某次更新到数据库的迁移
|
|
dotnet ef database update 某次迁移的前一次迁移名称 -p IRaCIS.Core.Test -c IRCContext
|
|
|
|
|