entity framework migrations midway through project -


i wrote small wpf app using ef without enabling migrations while ago , deployed. have continued work on application , have realised current version going fail when redeploy because have not got upgrade scripts.

does idea below sound work?

create new project , use ef, enabling migrations. create new model project , dal. create model pointing existing deployed db , set initial migration. enable migrations on existing project , paste migrations folder existing project add migration.

my thinking initial db matching existing deployed schema when add migration check against initial , create me up/down when next deploy.

any advice appreciated.

my deployment had had migrations enabled (i found out after taking backup, don't remember running must've because have _migrationhistory table!!!!), unfortunately, , amateurishly, had deleted migrations folder dev code , not checked source control prior doing so.... i:

  1. backed client database
  2. restored backup step 1 on local sqlexpress
  3. pointed application connection string @ newly restored db
  4. opened package manager console
  5. selected dal project default project
  6. ran "enable-migrations"

this straight away picked previous, initial creation database. takes me before messed around , deleted migrations folder project!!!

thank ms boys & girls.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -