Skip to content

Commit

Permalink
Making info a text column
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Jan 6, 2010
1 parent d031bd9 commit a8e9ae5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions db/migrate/20100106135010_rename_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class RenameInfo < ActiveRecord::Migration
def self.up
infos = Whisper.all.map { |w| [w.id, w.info] }

remove_column :whispers, :info
add_column :whispers, :info, :text

infos.each do |id, info|
w = Whisper.find(id)
w.info = info
w.save
end
end

def self.down
raise ActiveRecord::IrreversibleMigration
end
end

0 comments on commit a8e9ae5

Please sign in to comment.