c# - Entity Framework Code First not updating DB when there are conflicts -


i have strange problem ef. i've got creating , updating database following code:

in global.asax:

database.setinitializer(new migratedatabasetolatestversion<project.models.datacontext, configuration>()); 

in migrations/configuration:

public configuration() {     automaticmigrationsenabled = true;     automaticmigrationdatalossallowed = true; } 

my understanding automaticmigrationdatalossallowed should drop tables , re-create them, if means data loss.

now part works. however, if have field nvarchar (string) text in (say "abcd"). if change field integer data type, ef nothing db , app doesn't work.

i have thought drop table, re-create , record abcd it's bad luck? or have misinterpreted? or missing code?


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

html - grunt SVG to webfont -

c# - SharpSsh Command Execution -