I have an idea to add "missing migration" check to my CI pipeline. This check should validate that DbSnapshot that is present in a branch matches models in that branch (in another words, it should validate that if I will create a migration, Up and Down would be empty).
Straightforward way of doing this would be to execute dotnet ef migrations add Test and validate that resulting files match "empty migration" ones, but this seems like a hack.
Is there an easier way of doing this? Like dotnet ef migrations --verify-snapshot-up-to-date or something?
Starting EF Core 8 there's a dotnet ef migrations has-pending-model-changes command that does that 🎉
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With