You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
587B

  1. require 'rubygems'
  2. require 'active_record'
  3. require 'yaml'
  4. task :default => :migration
  5. desc "Migrate the database through scripts in migrate directory. Target specific version with VERSION=X"
  6. task :migration => :environnement do
  7. ActiveRecord::Migrator.migrate('migrate', ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
  8. end
  9. task :environnement do
  10. ActiveRecord::Base.establish_connection(:adapter => 'mysql', :database => 'test', :user => 'root', :password => 'm3rl1p', :socket => '/var/run/mysql/mysql.sock')
  11. ActiveRecord::Base.logger = Logger.new(File.open('database.log', 'a'))
  12. end