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:
- backed client database
- restored backup step 1 on local sqlexpress
- pointed application connection string @ newly restored db
- opened package manager console
- selected dal project default project
- 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
Post a Comment