c# - Resetting Context for Entity Framework 5 so it thinks its working with a initialised Database - Code First -


linked question:

cannot split table ef 5 - code first - existing database

but think answer question not problem code first did whilst developing.

the scenario this:

  1. had existing database , used begin creating data context
  2. began working realised naming conventions poor , tables needed remodelling.
  3. decided create new database better conventions existing tables taken across , remodelled new bits
  4. updated context @ new database
  5. even though migrations not enabled, getting errors database being out of sync (even though until morning still pulling data)
  6. i enabled migrations (comment in other question) , output script. , can see sync changes things table names , id properties etc.

i can't move forwards, context seems not when switch databases on (which point brittle). need somehow reset context doesn't think changes have been made database , thinks working initial database again.

i have deleted migrations folder, nothing. there sort of way can happen?

try deleting __migrationhistory table in database. it's system one.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -