Add migrations has-pending-model-changes Command#31164
Conversation
|
Open questions:
|
|
You can add tests to Tests/Design/Internal/MigrationsOperationsTest.cs. See the ones in DbContextOperationsTest for a better example. |
📝 Design Meeting Notes
|
|
@justindbaur Alright, the comments should contain all the changes we'd like to see before mering this. Let us know if you have any follow up questions. It's looking really good. |
|
@bricelam Thank you so much, I did start trying to write some tests but was having some issues because |
migrations check-pending Commandmigrations has-pending-model-changes Command
|
Hi @bricelam I believe I have addressed all feedback, the tests are not the prettiest things I have ever written. I had a bit of a learning curve trying to figure out how a snapshot model and design time model are created so I could best fake them while still achieving a high probability that the test is actually testing something. Let me know if you have a better way of achieving what I did. |
src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Relational.Tests/RelationalDatabaseFacadeExtensionsTest.cs
Outdated
Show resolved
Hide resolved
- Add command - Add DatabaseFacade extension method
|
Merged! Thanks, @justindbaur. I rebased and made a few minor tweaks |
|
@bricelam Thank you so much for taking it across the finish line. Can't wait to add this to our CI! |
Fixes #26348
I could not find anything that tests
MigrationOperationsmethods or anything that directly tests the CLI. Please let me know if I missed anything and I'd be happy to write some tests.My biggest question is the code I added in
MigrationsOperations. It seems like a bit to much code for what normally goes in those methods but I don't know where the ideal location for this logic would sit. The code I wrote is a combination of the existing code here and from the comment on the issue here.Also feel free to let me know the exact wording you would like for the resource strings, I doubt what I have there is great.