How to recreate my EF CodeFirst Table?

code-first, entity-framework

Solution

In system tables there is a table called

__MigrationHistory

...I deleted it.

In Package manager console ran command "update-database" Problem fixed!

More info:

http://blog.oneunicorn.com/2012/02/27/code-first-migrations-making-__migrationhistory-not-a-system-table/

Problem

I created a Code First class A database was created in Sql automatically. I deleted the tables :( I have migrations enabled: ``` AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = true; Database.SetInitializer(new DropCreateDatabaseAlways<SurveyContext>()); ``` Yet upon ``` update-database -force Cannot find the object "dbo.CustomerResponses" because it does not exist or you do not have permissions. ``` Please help.

Original source

Related problems