Sha256: 372ca77871e1a77e008203fd45fb413510afb09c85f561890e69938077dc94ae
Contents?: true
Size: 579 Bytes
Versions: 13
Compression:
Stored size: 579 Bytes
Contents
class ChangedChameleonsAddedNewLongerSpotsAndMovedNewSpots < ActiveRecord::Migration def self.up add_column :chameleons, :new_longer_spots, :text puts "-- copy data from :new_spots to :new_longer_spots" Chameleon.update_all("new_longer_spots = new_spots") remove_column :chameleons, :new_spots end def self.down add_column :chameleons, :new_spots, :string, :limit=>255 puts "-- copy data from :new_longer_spots to :new_spots" Chameleon.update_all("new_spots = new_longer_spots") remove_column :chameleons, :new_longer_spots end end
Version data entries
13 entries across 13 versions & 1 rubygems