Detect if Entity Framework model is too old for database using MigrationHistory -


We have switched code-first unit framework migration from manual coding database migration. In our old setup, we were able to check whether the database is very new or not. This is important because it will probably be incompatible. Unfortunately I can not find a good way to find out what the current database is, or whether it is too old or not.

In case of use, the customer has 2 versions of our software. The client first starts the latest version, which has recent migration compared to the older version. The client then starts the old version of the software. Currently the software will crash and burn because the model is incompatible.

You can use <

  DbMigrator .GetDatabaseMigrations   

var configuration = new configuration (); Var migrator = new dbmigator (configuration); Migrator.Update ();



Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -