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.22.9 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.8 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.7 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.6 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.5 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.4 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.2 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.1 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.22.0 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.21.2 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.21.1 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.21.0 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.20.1 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.9 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.8 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.7 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.6 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.5 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.4 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb
think_feel_do_engine-3.19.3 db/migrate/20140621023345_convert_slides_slideshows_to_bit_core.bit_player.rb