I am using EF Core. After "cleverly" merging a couple of source control branches that both introduced migrations, I'm no longer confident that my
ModelSnapshot is consistent with either my migrations or my actual database.
Is there some command or function that I can use to validate that the three are consistent with each other (i.e. that the snapshot is a faithful representation of the current database schema and that the migrations, when applied to a newly-created database, will generate that schema)?
Here are tools you can use to perform some sanity checks.
Add-Migrationwill show any differences between your current model and the model snapshot
Script-Migrationwill produce a SQL script you can use to create a database from the migrations
Scaffold-DbContextwill create a model that is compatible with a database