By removing EdmMetadata table in EF 4.3, It seems DropCreateDatabaseIfModelChanges no longer works. does it?
OR
Is there a way to declare initializer as I do in SEED method of EF 4.2 ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EdmMetadatais obsoleted in EF 4.3 Code First models, instead it use_MigrationHistorytable to check compatibility between Model and Database.(Note that the _MigrationHistory table is made a system table if possible. This means that to see it you may need to expand the “System Tables” in SQL Management Studio or your preferred tool.)
In EF 4.3, when DbContext is used with the Code First approach,
Database.Createattempts to use Code First Migrations to create the database and perform DDL.Database.Createperforms an initial automatic migration for you. As part of this process, migrations will create a table called_MigrationHistoryand insert a row into this table containing a compressed version of your Code First model. And DropCreateDatabaseIfModelChanges initializers use theDatabase.CompatibleWithModelmethod to determine whether or not the Code First model matches the model that was used to create the database by checking _MigrationHistory table.http://blog.oneunicorn.com/2012/01/13/ef-4-3-beta-1-what-happened-to-that-edmmetadata-table/