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:
- had existing database , used begin creating data context
- began working realised naming conventions poor , tables needed remodelling.
- decided create new database better conventions existing tables taken across , remodelled new bits
- updated context @ new database
- even though migrations not enabled, getting errors database being out of sync (even though until morning still pulling data)
- 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
Post a Comment