aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/extensions.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/extensions.rake')
-rw-r--r--lib/tasks/extensions.rake15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tasks/extensions.rake b/lib/tasks/extensions.rake
new file mode 100644
index 000000000..6ede62b10
--- /dev/null
+++ b/lib/tasks/extensions.rake
@@ -0,0 +1,15 @@
+namespace :db do
+ desc 'Creates shared_extensions Schema and enables hstore extension'
+ task :extensions => :environment do
+ ActiveRecord::Base.connection.execute 'CREATE SCHEMA IF NOT EXISTS shared_extensions;'
+ ActiveRecord::Base.connection.execute 'CREATE EXTENSION IF NOT EXISTS hstore SCHEMA shared_extensions;'
+ end
+end
+
+Rake::Task["db:create"].enhance do
+ Rake::Task["db:extensions"].invoke
+end
+
+Rake::Task["db:test:purge"].enhance do
+ Rake::Task["db:extensions"].invoke
+end