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