Sha256: 9a786783be23aae8e35cafcb0625941046c14153c801f671bfdff86212fadf9d
Contents?: true
Size: 948 Bytes
Versions: 7
Compression:
Stored size: 948 Bytes
Contents
class ChangeIsCommentToItemType < ActiveRecord::Migration def change add_column :inkwell_blog_items, :item_type, :string ::Inkwell::BlogItem.where(:is_comment => true).update_all(:item_type => 'c') ::Inkwell::BlogItem.where(:is_comment => false).update_all(:item_type => 'p') remove_column :inkwell_blog_items, :is_comment add_column :inkwell_favorite_items, :item_type, :string ::Inkwell::FavoriteItem.where(:is_comment => true).update_all(:item_type => 'c') ::Inkwell::FavoriteItem.where(:is_comment => false).update_all(:item_type => 'p') remove_column :inkwell_favorite_items, :is_comment add_column :inkwell_timeline_items, :item_type, :string ::Inkwell::TimelineItem.where(:is_comment => true).update_all(:item_type => 'c') ::Inkwell::TimelineItem.where(:is_comment => false).update_all(:item_type => 'p') remove_column :inkwell_timeline_items, :is_comment end end
Version data entries
7 entries across 7 versions & 1 rubygems