irc-netcore-api/IRaCIS.Core.Test/CodeFirstTest/CodeFirst使用说明

15 lines
447 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