Skip to content

Instantly share code, notes, and snippets.

@brentsowers1
Created March 6, 2014 02:19
Show Gist options
  • Select an option

  • Save brentsowers1/9380993 to your computer and use it in GitHub Desktop.

Select an option

Save brentsowers1/9380993 to your computer and use it in GitHub Desktop.
script/db_migrate to run migrations in deployed WAR files
require 'rubygems'
require 'active_record'
require 'yaml'
config = YAML::load(File.open(File.expand_path('../../config/database.yml', __FILE__)))
ActiveRecord::Base.establish_connection(config["production"])
ActiveRecord::Migrator.migrate(File.expand_path('../../db/migrate', __FILE__) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment