Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 32 lines (20 sloc) 0.879 kB
fbfb928 @pdcawley r720@Menhir: pdcawley | 2005-12-07 11:18:45 +0000
pdcawley authored
1 #!/usr/bin/env ruby
2
3 require 'optparse'
4 require File.dirname(__FILE__) + '/../config/boot'
5
6 options = { :environment => (ENV['RUBY_ENV'] || "development").dup }
7
8 ARGV.options do |opts|
9 script_name = File.basename($0)
10
11 opts.banner = "Usage: migrate [options]"
12 opts.separator ""
13
14 opts.on("-e", "--environment=name", String,
15 "Specifies the environment to migrate (test/development/production).",
16 "Default: development") { |options[:environment]| }
17
18 opts.separator ""
19
20 opts.on("-h", "--help",
21 "Show this help message.") { puts opts; exit }
22
23 end
24
25 ENV["RAILS_ENV"] = options[:environment]
26 RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV)
27
28 require RAILS_ROOT + '/config/environment'
29
30 ActiveRecord::Migrator.migrate(RAILS_ROOT + "db/migrate/",
31 ENV["VERSION"] ? ENV["VERSION"].to_i : nil )
Something went wrong with that request. Please try again.