Sha256: 06c6832fad4d0988f4686c474d75ac85e9bf5a463c9d53ff9e105f438988aaf1

Contents?: true

Size: 1.31 KB

Versions: 68

Compression:

Stored size: 1.31 KB

Contents

# This migration comes from bit_player (originally 20140620182756)
class BitPlayer::Slideshow < ActiveRecord::Base; end
class BitPlayer::Slide < ActiveRecord::Base; end
class BitPlayer::VideoSlide < BitPlayer::Slide; end

class ConvertSlidesSlideshowsToBitCore < ActiveRecord::Migration
  def up
    BitPlayer::Slideshow.all.each do |slideshow|
      BitCore::Slideshow.create!(title: slideshow.title, id: slideshow.id)
    end
    BitCore::ContentProviders::SlideshowProvider.all.each do |provider|
      provider.update!(source_content_type: "BitCore::Slideshow")
    end
    BitPlayer::Slide.all.each do |slide|
      type = (slide.type || "").gsub(/BitPlayer::VideoSlide/, "BitCore::VideoSlide")
      BitCore::Slide.create!(
        title: slide.title,
        id: slide.id,
        body: slide.body,
        position: slide.position,
        bit_core_slideshow_id: slide.bit_player_slideshow_id,
        type: type,
        options: slide.options,
        is_title_visible: slide.is_title_visible
      )
    end
    execute <<-SQL
      ALTER TABLE bit_player_slides
        DROP CONSTRAINT IF EXISTS fk_slides_slideshows
    SQL

    execute <<-SQL
      ALTER TABLE bit_player_slides
        DROP CONSTRAINT IF EXISTS bit_player_slide_position
    SQL
    drop_table :bit_player_slides
    drop_table :bit_player_slideshows
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.2 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.1 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.0 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.18.0 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.17.2 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.17.1 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.17.0 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.16.3 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.16.2 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.16.1 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.7 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.16.0 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.6 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.5 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.4 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.3 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.2 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.1 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.15.0 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.14.9 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb