Ridgepole-rails provides two Rake tasks: ridgepole:export
and ridgepole:apply
They wrap ridgepole's ridgepole --export
and
ridgepole --apply
respectively.
To export current schema of the database to Schemafile
rake ridgepole:export
To apply Schemafile to the database
rake ridgepole:apply
Some db tasks of Rails are replaced as follows:
db:migrate
invokesridgepole:apply
thenridgepole:export
db:schema:dump
invokesridgepole:export
db:schema:load
invokesridgepole:apply
db:test:load
invokesridgepole:apply
with first argument:test
db:migrate:status
,db:rollback
anddb:version
are undefined
TODO: Some means not to replace these tasks above.
Add this line to your application's Gemfile:
gem 'ridgepole-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ridgepole-rails
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.