The Decider said over 3 years ago permalink Comment? (0)
Tagged: migration version schema_info SchemaInfo

Getting at schema_info or SchemaInfo

I’m writing a utility that will be executed using script/runner and needed to get at the table schema_info where the migration version is held. This worked:

class SchemaInfo < ActiveRecord::Base set_table_name :schema_info set_primary_key :version attr_accessor :version

def version_before_type_cast end def self.version self.find(:first).id end

end

[1514][chadb@Jokerman:~/Sites/surveil/trunk]$ script/console
Loading development environment.
>> SchemaInfo.version
=> 149
>> quit

The Decider said over 3 years ago permalink Comment? (0)
Tagged: migration production

Migrate your production environment

I always have to think a bit about this but it’s really quite simple in unix os. On the command line try:

RAILS_ENV='production' rake db:migrate