You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
I need to be able to create a CI job that can verify that there have been no changes to our database schema without a migration being added for it. So that I can create a PR gate.
Solution:
I would love a command in the dotnet ef CLI to verify no migrations are needed, something like.
dotnet ef migrations verify-no-changes
This would respond with exit code 0 if no migrations are needed and exit code 1 if migrations are needed.
I believe it would essentially just need to gather up operations like here:
Then it would just check that both lists are empty. I would be more than willing to work on this if the idea is approved.
Alternate Solution:
Add an additional options to dotnet ef migrations add for --ensure-empty so that it will fail when there are operations that are needed and will return with a non-zero exit code.
The text was updated successfully, but these errors were encountered:
Problem:
I need to be able to create a CI job that can verify that there have been no changes to our database schema without a migration being added for it. So that I can create a PR gate.
Solution:
I would love a command in the
dotnet ef
CLI to verify no migrations are needed, something like.dotnet ef migrations verify-no-changes
This would respond with exit code 0 if no migrations are needed and exit code 1 if migrations are needed.
I believe it would essentially just need to gather up operations like here:
efcore/src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs
Lines 145 to 146 in 702f1ce
Then it would just check that both lists are empty. I would be more than willing to work on this if the idea is approved.
Alternate Solution:
Add an additional options to
dotnet ef migrations add
for--ensure-empty
so that it will fail when there are operations that are needed and will return with a non-zero exit code.The text was updated successfully, but these errors were encountered: