Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails plugin that creates a dump directory with one file per record - much friendlier for git

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
features
lib
spec
.gitignore
History.txt
License.txt
README.rdoc
Rakefile
Todo.txt
cucumber.yml
init.rb

README.rdoc

git friendly dumper

Use fixtures to create a db independent and git friendly db dump.

It's git friendly because each record is in its own file (git doesn't do very well with large files that are committed all at once).

If using the schema option (ie. db:dump & db:load), then each table's schema definition is included as is the schema_migrations table.

Example usage:

# drop-in replacement for mysqldump

  rake db:dump DUMP_PATH=some/path
  # just like mysqldump -u <user> -p<pass> <app>_development > some/path.sql

  rake db:load DUMP_PATH=some/path
  # just like script/dbconsole -p < some/path.sql

# without schema information, just the data

  rake db:data:dump DUMP_PATH=some/path # dump the data without touching the structure
  rale db:data:load DUMP_PATH=some/path # load the data without touching the structure

# just load particular table data

  rake db:data:load DUMP_PATH=some/path TABLES=users,things

Notes

It's probably a bad idea to check your dump into the same repo as your app.

I created this so that we could have incremental scheduled backups of the db. With a database of 120M containing many binary columns, this resulted in a massive saving in bandwidth.

Basically, we have the db backup inside the app, but ignored by the main app, the db/dump has it's own git repo.

CI

It's tested against master (2.3) and 2-2-stable branches

Something went wrong with that request. Please try again.