Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (20 sloc) 0.615 kb
6402e1e @markoa Set up ActiveRecord.
markoa authored
1 namespace :db do
2 task :environment do
3 require 'active_record'
4 require 'logger'
5
6 DB_CONFIG = YAML.load_file("database.yml")
7
8 ActiveRecord::Base.establish_connection(
9 :adapter => DB_CONFIG['adapter'],
10 :host => DB_CONFIG['host'],
11 :username => DB_CONFIG['username'],
12 :password => DB_CONFIG['password'],
13 :database => DB_CONFIG['name']
14 )
15 end
16
17 desc "Migrate the database"
18 task(:migrate => :environment) do
19 ActiveRecord::Base.logger = Logger.new(STDOUT)
20 ActiveRecord::Migration.verbose = true
21 ActiveRecord::Migrator.migrate("db/migrate")
22 end
23 end
Something went wrong with that request. Please try again.