Add command for synchronizing database to mage.rb

Added following commands:

cap mage:db:anonymize: Execute custom sql-Script specified in "local_anonymize_sql_file" after database-synchronization. Useful for anonymize customer-data or configuration-data like base_urls.

cap mage:db:cleanup: Removes Dump-File from remote server if db_dump_cleanup is true. Useful for shared hosting.

cap mage:db:dump: Dumps remote database excluding ignored tables specified in db_dump_ignore_tables

cap mage:db:import: Imports downloaded dump into local database

cap mage:db:pull: Downloads dump to local temporary file

cap mage:db:sync: wrapper of all the functions above.


Configure it in your local deploy.rb like this:

set :magento_path, '../../html'
set :ignore_tables, ["cataloginventory_stock_status_tmp", "catalog_product_flat_1",...]
set :local_anonymize_sql, '../../sql/update.sql'