Sha256: 64ed82ee9e6f280c448dd1b79814f24a289a6af1811c6f1c648b83f5a4530107

Contents?: true

Size: 1023 Bytes

Versions: 15

Compression:

Stored size: 1023 Bytes

Contents

class AddConfigTypesToConfigs < ActiveRecord::Migration
  def change
    unless table_exists?(:configuration_item_types_configurations)
      create_table :configuration_item_types_configurations, {:id => false} do |t|
        t.references :configuration_item_type
        t.references :configuration

        t.timestamps
      end

      add_index :configuration_item_types_configurations, :configuration_item_type_id, :name => 'conf_item_type_conf_opt_id_item_idx'
      add_index :configuration_item_types_configurations, :configuration_id, :name => 'conf_id_idx'
    end

    unless column_exists? :configuration_item_types_configuration_options, :id
      add_column :configuration_item_types_configuration_options, :id, :integer
      add_column :configuration_item_types_configuration_options, :is_default, :boolean, :default => false

      #remove_index :configuration_item_types, 'configuration_item_dflt_opt_idx'
      remove_column :configuration_item_types, :default_configuration_option_id
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
erp_app-3.0.16 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.15 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.14 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.13 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.12 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.10 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.9 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.8 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.7 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.6 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.5 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.4 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.3 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.2 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb
erp_app-3.0.1 db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb