-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
add-migration is no longer adding created migration files to project #28716
Comments
Add test projects/solution |
@ronaldhoek Why are you excluding the Migrations folder from building, etc. in your project? Do the added migrations show up in the project when you don't do this? |
This was done to ensure the migration files would be added explicitly to the project and would therefore give a merge conflict when more than one PR with migration scripts we're being reviewed/merged.
Yes, but that's of course de default behavior of VS... But as the order of files AND the fact that creating scripts based on a previous model is of great importance, the 'old' behavior (automatically adding new scripts to the project file) would be desirable (again). |
@ronaldhoek This was never the intended behavior. Possibly something changed in the way we're using the VS API's, or, more likely, it was never intended there either. Either way, this is not something we plan to bring back. |
Thanks for the replies and for looking into it. |
@ajcvickers I think this change may be related: #24937 |
@ErikEJ hmmm, looks related to my issue - but it speaks about 'conditionally' adding the created script files (in the past I already noticed, that remove-migration would not remove the file from the project - so might that also be related). I'll add this comment also to issue #24937 |
After upgrading from EFCore 5.0.11 (.NET Core 3.1) to EFCore 6.0.6 (.NET 6) the 'add-migration' command no longer adds the migration scripts to the data project.
The 'Test.Data' project has the following config regarding the 'Migration' folder:
Steps
Test.Api
as startup projectTest.Data
add-migration next -verbose
Result: script is created but not added to the [project
Test.Data
as it was when using .NET Core 3.1/EF 5.0.11Package Manager Console output
Provider and version information
EF Core version: 6.0.6
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6.0
Operating system:
IDE: Visual Studio 2022 17.3.0
The text was updated successfully, but these errors were encountered: