ef Migration 的一些基础命令


  • cmd ci 命令
    dotnet ef migrations add NewColum --新增migrations
    dotnet ef database update--跟新数据库
    dotnet ef migrations add Addrs--新增一个migrations
    dotnet ef database update
    dotnet ef datebase update NewColum--根据newcolum跟新数据库
    dotnet ef migrations remove--删除最新未使用的migrations

     

  • VS 程序包管理控制台命令
    Add-Migration InitConfigurations -Context ConfigurationDbContext -OutputDir Data\Migrations\IdentityServer\Configuration
    
    Add-Migration InitPersistedGrant -Context PersistedGrantDbContext -OutputDir Data\Migrations\IdentityServer\PersistedGrantDb
    
    DBcontext 在 Identityserver4.EntityFramwork.DbContexts 命名空间下
    
    Update-Database -Context ConfigurationDbContext 
    
    Update-Database -Context PersistedGrantDbContext

     


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM