Skip to content

Instantly share code, notes, and snippets.

@hubertlepicki
Created December 16, 2010 10:04
Show Gist options
  • Save hubertlepicki/743252 to your computer and use it in GitHub Desktop.
Save hubertlepicki/743252 to your computer and use it in GitHub Desktop.
require 'rails'
module Cms
class Engine < Rails::Engine
rake_tasks do
load "cms/railties/tasks.rake"
end
end
end
namespace :cms do
desc "Run cms migrations (options: VERSION=x, VERBOSE=false)."
task :migrate => :environment do
ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
ActiveRecord::Migrator.migrate(File.join(File.dirname(__FILE__), "../../../db/migrate/"), ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment