Sha256: bd072f68850ae5735967ff71b35a80f1cfac12c34d30e5c7b622e03d2f03eb55

Contents?: true

Size: 1012 Bytes

Versions: 14

Compression:

Stored size: 1012 Bytes

Contents

# This migration comes from inkwell (originally 20130202130030)
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

14 entries across 7 versions & 1 rubygems

Version Path
inkwell-2.0.0 test/dummy_without_community/db/migrate/20130213115833_change_is_comment_to_item_type.inkwell.rb
inkwell-2.0.0 test/dummy/db/migrate/20130210231424_change_is_comment_to_item_type.inkwell.rb
inkwell-1.5.2 test/dummy/db/migrate/20130210231424_change_is_comment_to_item_type.inkwell.rb
inkwell-1.5.2 test/dummy_without_community/db/migrate/20130213115833_change_is_comment_to_item_type.inkwell.rb
inkwell-1.5.1 test/dummy_without_community/db/migrate/20130213115833_change_is_comment_to_item_type.inkwell.rb
inkwell-1.5.1 test/dummy/db/migrate/20130210231424_change_is_comment_to_item_type.inkwell.rb
inkwell-1.4.1 test/dummy/db/migrate/20130210231424_change_is_comment_to_item_type.inkwell.rb
inkwell-1.4.1 test/dummy_without_community/db/migrate/20130213115833_change_is_comment_to_item_type.inkwell.rb
inkwell-1.2.0 test/dummy/db/migrate/20130210231424_change_is_comment_to_item_type.inkwell.rb
inkwell-1.2.0 test/dummy_without_community/db/migrate/20130213115833_change_is_comment_to_item_type.inkwell.rb
inkwell-1.1.7 test/dummy/db/migrate/20130210231424_change_is_comment_to_item_type.inkwell.rb
inkwell-1.1.7 test/dummy_without_community/db/migrate/20130213115833_change_is_comment_to_item_type.inkwell.rb
inkwell-1.1.1 test/dummy_without_community/db/migrate/20130213115833_change_is_comment_to_item_type.inkwell.rb
inkwell-1.1.1 test/dummy/db/migrate/20130210231424_change_is_comment_to_item_type.inkwell.rb