Reputation: 10363
I would like to have two DbContexts in the same project but automatic migrations enabled only for one. Is it possible?
Upvotes: 1
Views: 3343
Reputation: 10363
It is. Each DbMigrationsConfiguration
is bound to one specific DbContext
via ContextKey
. As soon as you have more than on DbContext
, the Enable-Migrations
command requires the -ContextTypeName
parameter. One can easily just run Enable-Migrations
for one DbContext and omit it for the other.
Upvotes: 3