Sha256: 17f28a5c5ad15533b4a732d14748b7ceb4d7e41daeea1e80dea4f662a2812d67

Contents?: true

Size: 894 Bytes

Versions: 14

Compression:

Stored size: 894 Bytes

Contents

# This migration comes from inkwell (originally 20130202130040)
class AddOwnerTypeToLines < ActiveRecord::Migration
  def change
    add_column :inkwell_blog_items, :owner_type, :string
    ::Inkwell::BlogItem.where(:is_owner_user => true).update_all(:owner_type => 'u')
    ::Inkwell::BlogItem.where(:is_owner_user => false).update_all(:owner_type => 'c')
    remove_column :inkwell_blog_items, :is_owner_user

    add_column :inkwell_favorite_items, :owner_type, :string
    ::Inkwell::FavoriteItem.update_all(:owner_type => 'u')
    rename_column :inkwell_favorite_items, "#{::Inkwell::Engine::config.user_table.to_s.singularize}_id", :owner_id

    add_column :inkwell_timeline_items, :owner_type, :string
    ::Inkwell::TimelineItem.update_all(:owner_type => 'u')
    rename_column :inkwell_timeline_items, "#{::Inkwell::Engine::config.user_table.to_s.singularize}_id", :owner_id
  end
end

Version data entries

14 entries across 7 versions & 1 rubygems

Version Path
inkwell-2.0.0 test/dummy_without_community/db/migrate/20130213115834_add_owner_type_to_lines.inkwell.rb
inkwell-2.0.0 test/dummy/db/migrate/20130212130848_add_owner_type_to_lines.inkwell.rb
inkwell-1.5.2 test/dummy/db/migrate/20130212130848_add_owner_type_to_lines.inkwell.rb
inkwell-1.5.2 test/dummy_without_community/db/migrate/20130213115834_add_owner_type_to_lines.inkwell.rb
inkwell-1.5.1 test/dummy_without_community/db/migrate/20130213115834_add_owner_type_to_lines.inkwell.rb
inkwell-1.5.1 test/dummy/db/migrate/20130212130848_add_owner_type_to_lines.inkwell.rb
inkwell-1.4.1 test/dummy/db/migrate/20130212130848_add_owner_type_to_lines.inkwell.rb
inkwell-1.4.1 test/dummy_without_community/db/migrate/20130213115834_add_owner_type_to_lines.inkwell.rb
inkwell-1.2.0 test/dummy/db/migrate/20130212130848_add_owner_type_to_lines.inkwell.rb
inkwell-1.2.0 test/dummy_without_community/db/migrate/20130213115834_add_owner_type_to_lines.inkwell.rb
inkwell-1.1.7 test/dummy/db/migrate/20130212130848_add_owner_type_to_lines.inkwell.rb
inkwell-1.1.7 test/dummy_without_community/db/migrate/20130213115834_add_owner_type_to_lines.inkwell.rb
inkwell-1.1.1 test/dummy_without_community/db/migrate/20130213115834_add_owner_type_to_lines.inkwell.rb
inkwell-1.1.1 test/dummy/db/migrate/20130212130848_add_owner_type_to_lines.inkwell.rb