New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate Migrations Project - does not work #4650
Comments
Duplicate of #4318 |
@ajcvickers I'm not sure this is a duplicate of that other issue. It seems like a different problem on the same document page. I updated my post because I realize I made some mistakes in there that removed clarity. Can you review my update? |
@jasekiw You may be right, and I can keep this open. But the main point is that that document needs updating across the board. |
@ajcvickers Sounds reasonable to me. |
Cuando intente crear el controlador desde la interfaz, haga clic en el campo Clase DbContext (+), cree un nuevo contexto y con él haga la creación del controlador. Todo funcionará, posteriormente haga el cambio desde el código apuntando al anterior contexto (el que da problema)... todo funcionará. Pero no podrá crear controladores con su propio contexto. |
A better way to handle migrations separately - https://github.com/k-basant/dotnet-ef-clean-modular-template/tree/main/db/ProjName.DBManager |
Type of issue
Code doesn't work
Description
I cloned the sample code and ran the command below that the documentation says should work and I get the following error:
Error:
So I add the dependency. and try again. Now I get
I Then added a design time factory:
This finally worked. Something else to note is that If the migrations are in a migrations folder under the migrations project, each migration re-adds the entire database even though the snapshot is there (using pomelo mysql). I think that it should be noted that migrations not directly in the root of the migrations project does not work correctly.
Page URL
https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/projects?tabs=dotnet-core-cli
Content source URL
https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/managing-schemas/migrations/projects.md
Document Version Independent Id
34bc1bac-7338-d8ab-390d-8c5e88a48c10
Article author
@bricelam
The text was updated successfully, but these errors were encountered: