Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 24 lines (19 sloc) 0.594 kB
e968fa0 @rodrigomanhaes open house
authored
1 require 'active_record'
2 require 'yaml'
3 require 'logger'
4 require 'sqlite3'
5
6 task :migrate => :environment do
7 ActiveRecord::Migrator.migrate('db/migrate',
8 ENV['VERSION'] ? ENV['VERSION'].to_i : nil)
9 end
10
3b5a064 @rodrigomanhaes add support to rollback migrations (closes #2)
authored
11 task :rollback => :environment do
12 ActiveRecord::Migrator.rollback('db/migrate',
13 ENV['STEP'] ? ENV['STEP'].to_i : 1)
14 end
15
e968fa0 @rodrigomanhaes open house
authored
16 task :environment do
14638c6 @douglascamata setting both test and develoment environments (closes #1)
douglascamata authored
17 ['test', 'development'].each do |env|
18 ActiveRecord::Base.establish_connection(
19 YAML::load(File.open('./config/database.yml'))[env])
20 ActiveRecord::Base.logger = Logger.new(File.open("./log/#{env}_database.log", 'a'))
21 end
e968fa0 @rodrigomanhaes open house
authored
22 end
23
Something went wrong with that request. Please try again.