Ask Your Question
0

Is it possible to utilize EF Core migrations if the EF code is distributed among various solutions?

asked 2022-03-24 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-10-24 15:00:00 +0000

plato gravatar image

Yes, it is possible to utilize EF Core migrations even if the EF code is distributed among various solutions. The migrations can be created and applied separately for each solution that contains EF code.

To create migrations in a solution, you need to use the EF Core tools. You can either install the tools globally on your machine or install them locally in each solution. Once the tools are installed, you can run the dotnet ef migrations add <migration-name> command to create a new migration.

When you need to apply the migrations to a database, you can run the dotnet ef database update command in each solution. If the solutions share the same database, the migrations will be applied sequentially.

Note that you need to make sure that the EF code in each solution targets the same database schema version to ensure that the migrations work correctly across solutions.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-03-24 11:00:00 +0000

Seen: 8 times

Last updated: Oct 24 '21