EF 4.3 Auto-Migrations with multiple DbContexts in one database

前端 未结 9 1767
梦谈多话
梦谈多话 2020-12-01 01:20

I\'m trying to use EF 4.3 migrations with multiple code-first DbContexts. My application is separated into several plugins, which possibly have their own DbContext regarding

9条回答
  •  长情又很酷
    2020-12-01 02:05

    I've got it working with manual migrations, but you can't downgrade as it can't discrimitate between configurations in the __MigrationHistory table. If I try and downgrade then it treats the migrations from the other configurations as automatic and since I don't allow data loss it fails. We will only ever be using it to upgrade though so it works for our purposes.

    It does seem like quite a bit ommision though, I'm sure it wouldn't be hard to support it provided there was no overlap between DbContexts.

提交回复
热议问题