-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
36 lines (28 loc) · 988 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace :db do
task :migrate do
require "sequel"
Sequel.extension :migration
DB = Sequel.postgres("farmsubsidy_development")
Sequel::Migrator.run(DB, './db/migrations', :use_transactions=>true)
end
task :set_up_performance_test_db do
require "sequel"
Sequel.extension :migration
#check to see if performance DB already exists
the_database_is_there = system("psql -l | grep farmsubsidy_performance")
if the_database_is_there
#if it does then drop the db
system("dropdb farmsubsidy_performance")
end
#and recreate it
system("createdb farmsubsidy_performance")
DB = Sequel.postgres("farmsubsidy_performance")
Sequel::Migrator.run(DB, './db/migrations', :use_transactions=>true)
end
task :run_any_new_migration do
require "sequel"
Sequel.extension :migration
DB = Sequel.postgres("farmsubsidy_performance")
Sequel::Migrator.run(DB, './db/migrations', :use_transactions=>true)
end
end