No release in over a year
Easily move tables between hosts in rails projects with Capistrano.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Capistrano::MysqlTables

Capistrano MysqlTables allows for easy transfer of MySQL tables between development and production environments.

Requirements

This plugin makes a couple of assumptions:

  • The existence of a config/database.yml file, as is used in Ruby on Rails environments.
  • That your production ssh user has their MySQL password setup in a ~/.my.cnf file as shown below. This is for security reasons, we don't want to pull the password out of the database.yml file and print to the command line.
[client]
password="your-super-cool-password"

Installation

Add this line to your application's Gemfile:

gem 'capistrano-mysql_tables'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install capistrano-mysql_tables

Then add to your Capfile with:

require "capistrano/mysql_tables"

Usage

The plugin provides two self-explanatory tasks, db:push_tables and db:pull_tables.

Run a task without any arguments, eg. cap production db:push_tables, and you'll be asked to provide one or more table names to move. Or you can provide the table names directly: cap production "db:push_tables[table1 table2]".

License

The gem is available as open source under the terms of the MIT License.