<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>config/database_sample.yml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -20,6 +20,10 @@ To migrate to a specific version (for example to rollback)
 
 rake db:migrate VERSION=20081220234130
 
+To migrate a specific database (for example your &quot;testing&quot; database)
+
+rake db:migrate RAILS_ENV=test
+
 CREDIT
 ------
 This work is based on Lincoln Stoll's blog post: http://lstoll.net/2008/04/stand-alone-activerecord-migrations/
@@ -32,7 +36,7 @@ gem install -y activerecord rake mysql
 
 cd standalone-migrations/config
 cp database_sample.yml database.yml
-edit database.yml (and change settings for your database)
+edit database.yml (and change settings for your database, the development database is the default)
 cd ../
 rake db:migrate (this will just create the schema_migrations table)
 (If you're familiar with rails there are also the tasks db:schema:dump and db:schema:load)</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,9 @@ Dir[&quot;#{APP_BASE}/**/lib&quot;].each { |p| $: &lt;&lt; p }
 namespace :db do
   task :ar_init do
     require 'active_record'
-    ActiveRecord::Base.establish_connection(YAML::load(File.open('config/database.yml')))
+    ENV['RAILS_ENV'] ||= 'development'
+    config = YAML.load_file(APP_BASE + '/config/database.yml')[ENV['RAILS_ENV']]
+    ActiveRecord::Base.establish_connection(config)
     logger = Logger.new $stderr
     logger.level = Logger::INFO
     ActiveRecord::Base.logger = logger
@@ -17,6 +19,7 @@ namespace :db do
     require 'migration_helpers/init'
     ActiveRecord::Migration.verbose = ENV[&quot;VERBOSE&quot;] ? ENV[&quot;VERBOSE&quot;] == &quot;true&quot; : true
     ActiveRecord::Migrator.migrate(APP_BASE + &quot;/migrations/&quot;, ENV[&quot;VERSION&quot;] ? ENV[&quot;VERSION&quot;].to_i : nil)
+    Rake::Task[ &quot;db:schema:dump&quot; ].execute
   end
 
   namespace :schema do</diff>
      <filename>Rakefile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>81c43e997f71a34ded654a1b3b05ad35df5d8c70</id>
    </parent>
  </parents>
  <author>
    <name>Todd Huss</name>
    <email>thuss@gabrito.com</email>
  </author>
  <url>http://github.com/thuss/standalone-migrations/commit/21bd73f52514b1e2afd558761fe02bd906699882</url>
  <id>21bd73f52514b1e2afd558761fe02bd906699882</id>
  <committed-date>2009-07-08T15:43:21-07:00</committed-date>
  <authored-date>2009-07-08T15:43:21-07:00</authored-date>
  <message>Implemented Bryon's enhancement suggested in my blogs comments to make standalone migrations rake tasks behave more like regular Rails migrations</message>
  <tree>7d92b369f1792cd21b73b1ae229c20b43a4718d1</tree>
  <committer>
    <name>Todd Huss</name>
    <email>thuss@gabrito.com</email>
  </committer>
</commit>
