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

Version Path
migrant-1.5.0 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.4.3 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.4.1 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.4.0 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.3.2 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.3.1 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.3.0 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.2.8 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.2.7 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.2.5 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.2.2 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.2.1 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
migrant-1.2.0 test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb