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
.rspec
Gemfile
Gemfile.lock.development
History.txt
MIT-LICENSE
README.rdoc
Rakefile
Todo.txt
cucumber.yml
git_friendly_dumper.gemspec

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
rake 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

See `lib/tasks/git_friendly_dumper_tasks.rake` and the features for more info

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.

Run the specs and features

Grab the last known good set of deps and run the specs and features

cp Gemfile.lock.development Gemfile.lock
bundle
rake
Something went wrong with that request. Please try again.