What is the equivalent of the -IgnoreChanges switch for entity-framework core in CLI?

后端 未结 2 1279
Happy的楠姐
Happy的楠姐 2021-01-18 07:00

With Visual Studio one can run the command

Add-Migration InitialCreate -IgnoreChanges 

in the Package Manage Console when creating the firs

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-18 07:35

    In the absence of any other way, one can empty the Up and Down method blocks of the migration of all code and run database update.

    public partial class Initial : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
    
        }
    
        protected override void Down(MigrationBuilder migrationBuilder)
        {
        }
    }
    

提交回复
热议问题