c# - MVC 3 EF Migrations on Multiple Database Instances -


all,

i trying solve seemingly common problem of updating our development database , our production database simultaneously, whenever change made our development database.

something this:

pm > add-migration addmynewcolumncolumntomytable pm > update-database - dev pm > update-database - prod  

i've seen solutions while researching nothing yet simple , straight forward running sqlcompare on dev , production databases , exporting , running sql script on production database.

how doing this?

thanks

well long both of databases following same migration stream meaning both created same migration , updated in same chronological order, should not have issues using same migrations.

what can create 2 connection strings in web.config (or app.config) , when updating database use following syntax:

update-database -connectionstringname yourproddbcontextconnectionstringname 

so assume have 5 migrations total: migration1, migration2, migration3, migration4 , migration 5.

if production updated migration3, , you've made migration4 , migration5 on dev database, issuing update-command different connection string production apply migration4 , migration5 @ same time, without problems.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -