How can EF5/CodeFirst be used to re-create a LocalDb database if it is deleted from the file system?
All of the articles I have found discuss enabling migrations or running update-database. Which only pertain to design time.
I'm looking for a solution that can be used at runtime.
I'm using DropCreateDatabaseIfModelChanges as a custom initializer and this works great during development and when the database is first created at runtime. However, the database is never created a second time, for example; if a user deletes the LocalDb database from the file system.
I've tried manually creating the database and, although the files get created successfully, the schema is never generated (error is "Model compatibility cannot be checked because the database does not contain model metadata.").
Thanks, in advance.