metator / application

A unit tested shopping cart application
http://metator.com
3 stars 0 forks source link

Development environments / Staging sites #6

Open joshribakoff opened 11 years ago

joshribakoff commented 11 years ago

In a web shop its common practice to have a localhost, some shared "staging site" and a live site. Certain things make sense in the database, like your products. Certain changes need to happen upon this data, like changing pricing. A client may want to preview these changes in a staging site prior to it going live. You can't just overwrite the production DB when its time to take it live, or you'll get "out of sync". For this reason settings should be stored on the filesystem so they can be deployed through Git. Any changes to the database like changing the price of a product should also log to the filesystem. Sort of like how phpmyadmin shows the SQL it ran when you edit a row. Metator should do that, but also log the SQL to a file. You could then use any database migration tool, like phinx, to run the the SQL log so that your edits to products can be repeated on the live site.

An alternative would be to export the products on localhost, and import on staging, then again on live. The problem there is you are only interested in "what has changed".