entity framework - ASP.NET Core 1 EF - migrations update to latest -


i have 2 migrations in asp.net core 1 mvc project follows:

migration vs2015

the v1 migration initial migration 1 table, restaurants.

i added v2 migration now, after added asp.net identity project, , want update db latest migration, getting error table exists.

dnx commands

the restaurant table exist, thought drop-create , add new tables well. none of new tables exist. used following commands create: dnx ef migrations add v2 , update: dnx ef database update, tried specifying v2 keeps trying migrate initial version only.

with migrations specified

how second migration update existing database?

update: added third migration, deleted database , reran update migrations command - time v1 , v2 ran, v3 did not. gives?

you need check "dbo.__migrationhistory" table if exists there in database. if not there, delete existing migrations. add new migration , update database. create , sync database model.

if deleting database delete existing migrations. , add new migration. still facing same issue open migration class , search table "restaurant". try figure out:

  • it added twice or not
  • it added once, comment out , re-run update database command see next error.

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -