I wanting to know how to run the 'Update-Database' command for a production database.
The 'Update-Database' database works fine from my local machine, but how do I get this to work for production data?
So, if I make a change to my application and then run the 'publish' through visual studio this works fine for the code side of things, but how do I run the 'Update-Database' command for the production data.
Hope this question makes sense...
To add on what @David said already...
Personally, I don't trust
automatic updates in 'live' scenarios, and I always prefer manual database administration (i.e. there is a problem with
permissions needed to create or alter Db - not to mention shared hosting etc.) - but from what I've seen migrations are pretty solid when it comes to synchronizing (in fact, the only way to 'untie' them normally is to remove the Db and force full/fresh update).
Here is a post I made a while ago on how to
synchronize database / code and geared towards deployment scenarios (and when problems arise). It doesn't apply to you (yet) but something to keep in mind.
See Using Entity Framework (code first) migrations in production so that your application automatically updates the database when the Entity Framework initializes.
Now if you're more comfortable having manual control over the migration, you could use the -Script argument to the Update-Database command on your developer machine to generate SQL scripts which you can then run against the production database.
http://msdn.microsoft.com/en-us/data/jj591621.aspx (see Getting A SQL Script section)