EF Migrations - how to manage during dev and deployment? -
we're considering using ef 4.3.1 code-based migrations, aren't clear how integrate migrations our present dev/deployment methodology...
the app in-question desktop wpf app, each desktop having own sql server instance (each 4 separate databases). deployed "field" environment 0 local support. database migration must done using sql scripts executed installer (probably installshield). there not available can run command @ pmc prompt upgrade db when deployed/upgraded @ field location. ultimate "output" ef migrations must set of sql scripts, installer selectively apply.
also, have multiple developers making concurrent database changes.. there no dba. each developer checks-in code (model) changes tfs, , next time get-latest, changes model automatically cause new database created on dev system. how can have each developer perform own local migrations (rather deleting/recreating local databases), , manage/consolidate/combine migrations? , collisions?
during dev , unit-testing, each developer may delete (entire) local database multiple times during single checkout/checkin iteration. works great code first, since database gets automatically rebuilt when app restarted. means _migrationhistory table in database gets deleted. how handle this? don't need migration history of each dev system? if not, where/how detect aggregate changes need applied delivered system?
i can see value of using migrations deal mechanics of migrating database, what's not clear how take advantage of without introducing centralized database "change-control" bottleneck dev cycle, , losing 1 of key benefits of code first.
any insight/advice appreciated!
dadcat
i know old question thought i'd post of experiences ef migrations (v6.1).
each dev fine. migrations put classes timestamp in name, no collisions happen. db on dev's machine updated after doing latest , running app (or update-database command).
deleting local db , recreating fine. make sure dev runs update-database before adding additional migrations or things out of sync. i'm bit confused why they'd need delete local db, that's out of scope. may find process needs change accommodate ef migrations.
i can't installer question, similar question brought me here. update-database command have -script option generate proper change script, i'm unclear how automate on build server.
Comments
Post a Comment