Sha256: 2a657ef5a98a095a5da0ecbb5b433d406820bc7243fb00cb7f5f701bb3206328

Contents?: true

Size: 830 Bytes

Versions: 7

Compression:

Stored size: 830 Bytes

Contents

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

7 entries across 7 versions & 1 rubygems

Version Path
inkwell-2.0.0 db/migrate/20130202130040_add_owner_type_to_lines.rb
inkwell-1.5.2 db/migrate/20130202130040_add_owner_type_to_lines.rb
inkwell-1.5.1 db/migrate/20130202130040_add_owner_type_to_lines.rb
inkwell-1.4.1 db/migrate/20130202130040_add_owner_type_to_lines.rb
inkwell-1.2.0 db/migrate/20130202130040_add_owner_type_to_lines.rb
inkwell-1.1.7 db/migrate/20130202130040_add_owner_type_to_lines.rb
inkwell-1.1.1 db/migrate/20130202130040_add_owner_type_to_lines.rb