Created
December 9, 2013 17:08
-
-
Save ayumin/7876011 to your computer and use it in GitHub Desktop.
rake task for enable hstore extension on PostgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
namespace :enable do | |
desc "enable hstore extension" | |
task :hstore => [:environment, :load_config] do | |
ActiveRecord::Base.connection.execute('CREATE EXTENSION IF NOT EXISTS hstore;') | |
end | |
end | |
Rake::Task['db:schema:load'].enhance ['db:enable:hstore'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment