DB Content plugin

Plugin details

The DB Content plugin for Rails adds tasks to save and restore database content.

Websitehttp://osteele.com/archives/2008/04/db-content-rails-plugin Repositorygit://github.com/osteele/db_content.git Author Oliver Steele Tags db LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/osteele/db_content.git

Usage
================

  # dump the development database to db/archive/development-content.sql.gz
  $ rake db:content:dump

  # load the dumped database, and apply any necessary migrations
  $ rake db:content:load

  # dump the production database to db/archive/production-content.sql.gz
  $ RAILS_ENV=production rake db:content:dump

  # save the development database to db/archive/{timestamp}.sql.gz
  $ rake db:content:save

  # save the (compressed) database to my-data.sql.gz
  $ rake db:content:save FILE=my-data.sql.gz

  # save the (uncompressed) database to my-data.sql
  $ rake db:content:save FILE=my-data.sql

  # load the database from my-data.sql
  $ rake db:content:load FILE=my-data.sql


Tasks
=========

  rake db:content:archive


Saves a timestamped database to db/archive/#{timestamp}.sql.gz

  rake db:content:dump


Dumps the database to FILE or db/#{RAILS_ENV}-content.sql.gz. If FILE ends in .gz, the file is compressed.

  rake db:content:load


Loads the database from FILE or db/#{RAILS_ENV}-content.sql.gz, and migrates it to the current schema version. If FILE ends in.gz, the file is piped through gunzip.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago