Skip to content

Commit

Permalink
Dump schema after migrations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwynholds committed Jan 11, 2011
1 parent e0833ec commit 2bbf858
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/active_column/tasks/ks.rb
Expand Up @@ -53,18 +53,21 @@
task :migrate => :set_keyspace do
version = ( ENV['VERSION'] ? ENV['VERSION'].to_i : nil )
ActiveColumn::Migrator.migrate ActiveColumn::Migrator.migrations_path, version
schema_dump
end

desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n)'
task :rollback => :set_keyspace do
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
ActiveColumn::Migrator.rollback ActiveColumn::Migrator.migrations_path, step
schema_dump
end

desc 'Pushes the schema to the next version (specify steps w/ STEP=n)'
task :forward => :set_keyspace do
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
ActiveColumn::Migrator.forward ActiveColumn::Migrator.migrations_path, step
schema_dump
end

namespace :schema do
Expand Down

0 comments on commit 2bbf858

Please sign in to comment.