Consolidating EF migrations into new InitialCreate

后端 未结 4 1691
轮回少年
轮回少年 2021-02-01 01:18

I have been using EF migrations for some time now and have more than 100 migration files in my project. I would like to consolidate these into a single migration before moving f

4条回答
  •  旧时难觅i
    2021-02-01 01:50

    If you're not concerned with keeping this migrations, what I've done is delete everything in your migrations folder, and then target a new database in the connection string (or pass in a new one). After that, you can just run the add-migration command:

    add-migration InitialCreate
    

    And it should create the migration for you.

提交回复
热议问题