How to use PowerShell to batch call Update-Database -
we use azure elastic pool resulting in multiple client databases , 1 master database references client database.
we have multiple databases , working on new version of code. use ef6 code-first. when make change our model (add property) create migration file , need call update-database
existing client databases. monkey work want skip.
i have powershell script connect master database , execute query on table. returns names of child databases. can change web.config , replace template database name proper name of child database.
now need call update-database
execute migration scripts. last part i'm struggling because i'm running ps1-script outside visual studio , command update-database
unknown. tried using migrate.exe
lots of errors.
i think easiest solution run script within package manager console
can't figure out how that.
you may want take @ azure elastic database jobs. designed work elastic database pools.
the elastic database jobs sdk includes powershell components.
Comments
Post a Comment