Sha256: 732b4e601ca89d82491ddc80fb631d07a2c75f62935b3d03da55f07d35918c23
Contents?: true
Size: 570 Bytes
Versions: 18
Compression:
Stored size: 570 Bytes
Contents
module Comatose class Page < ActiveRecord::Base set_table_name 'comatose_pages' end end class <%= class_name %> < ActiveRecord::Migration # Upgrades schema from version 0.4 to version 0.6 def self.up add_column :comatose_pages, "created_on", :datetime puts "Setting created_on times..." Comatose::Page.find(:all).each do |page| page.update_attribute('created_on', page.updated_on || Time.now) end end # Downgrades schema from version 0.6 to version 0.4 def self.down remove_column :comatose_pages, "created_on" end end
Version data entries
18 entries across 18 versions & 6 rubygems