Sha256: 0e978fd76bb8f1b8f46c00cdf8a42141b0bf9d07845cad719a0e77fa435d092e

Contents?: true

Size: 1.23 KB

Versions: 68

Compression:

Stored size: 1.23 KB

Contents

# This migration comes from bit_player (originally 20140402225703)
class ChangeModuleContextToTool < ActiveRecord::Migration
  def up
    #add_column :bit_player_content_modules, :bit_player_tool_id, :integer
    #BitPlayer::ContentModule.reset_column_information
    #BitPlayer::ContentModule.all.each do |content_module|
    #  tool = BitPlayer::Tool.find_or_create_by_title(content_module.context)
    #  content_module.update!(bit_player_tool_id: tool.id)
    #end
    #change_column_null :bit_player_content_modules, :bit_player_tool_id, false
    #remove_column :bit_player_content_modules, :context
    #execute <<-SQL
    #  ALTER TABLE bit_player_content_modules
    #    ADD CONSTRAINT fk_content_modules_tools
    #    FOREIGN KEY (bit_player_tool_id)
    #    REFERENCES bit_player_tools(id)
    #SQL
  end

  def down
    #execute <<-SQL
    #  ALTER TABLE bit_player_content_modules
    #    DROP CONSTRAINT fk_content_modules_tools
    #SQL
    #add_column :bit_player_content_modules, :context, :string, null: false, default: "home"
    #BitPlayer::ContentModule.all.each do |content_module|
    #  content_module.update(context: content_module.tool.title)
    #end
    #remove_column :bit_player_content_modules, :bit_player_tool_id
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

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