Sha256: da8243405cbe728d03ed3c84f8db1ddd214daa66540c3d683ae069883c9fbd08

Contents?: true

Size: 1.97 KB

Versions: 12

Compression:

Stored size: 1.97 KB

Contents

# This migration comes from erp_products (originally 20080805000041)
class BaseProductsIndexes < ActiveRecord::Migration
  def self.up
    add_index :product_types, :parent_id
    add_index :product_types, [:product_type_record_id, :product_type_record_type], 
              :name => "bpi_1"

    add_index :product_instances, :parent_id
    add_index :product_instances, [:product_instance_record_id, :product_instance_record_type], 
              :name => "bpi_2"
    add_index :product_instances, :product_type_id
    
    add_index :product_offers, [:product_offer_record_id, :product_offer_record_type], 
              :name => "bpi_3"
    
    add_index :simple_product_offers, :product_id
    
    add_index :prod_instance_reln_types, :parent_id
    
    add_index :prod_instance_role_types, :parent_id
    
    add_index :prod_instance_relns, :prod_instance_reln_type_id
    add_index :prod_instance_relns, :status_type_id
    
    add_index :prod_type_reln_types, :parent_id
    
    add_index :prod_type_role_types, :parent_id
    
    add_index :prod_type_relns, :prod_type_reln_type_id
    add_index :prod_type_relns, :status_type_id
  end

  def self.down
    remove_index :product_types, :parent_id
    remove_index :product_types, :name => "bpi_1"

    remove_index :product_instances, :parent_id
    remove_index :product_instances, :name => "bpi_2"
    remove_index :product_instances, :product_type_id
    
    remove_index :product_offers, :name => "bpi_3"
    
    remove_index :simple_product_offers, :product_id
    
    remove_index :prod_instance_reln_types, :parent_id
    
    remove_index :prod_instance_role_types, :parent_id
    
    remove_index :prod_instance_relns, :prod_instance_reln_type_id
    remove_index :prod_instance_relns, :status_type_id
    
    remove_index :prod_type_reln_types, :parent_id
    
    remove_index :prod_type_role_types, :parent_id
    
    remove_index :prod_type_relns, :prod_type_reln_type_id
    remove_index :prod_type_relns, :status_type_id
  end
end

Version data entries

12 entries across 12 versions & 7 rubygems

Version Path
erp_orders-3.1.1 spec/dummy/db/migrate/20130107205939_base_products_indexes.erp_products.rb
erp_txns_and_accts-3.1.1 spec/dummy/db/migrate/20130107205653_base_products_indexes.erp_products.rb
erp_commerce-3.1.3 spec/dummy/db/migrate/20130107205830_base_products_indexes.erp_products.rb
erp_products-3.1.1 spec/dummy/db/migrate/20130107214713_base_products_indexes.erp_products.rb
erp_commerce-3.1.1 spec/dummy/db/migrate/20130107214963_base_products_indexes.erp_products.rb
erp_invoicing-3.1.0 spec/dummy/db/migrate/20121214000246_base_products_indexes.erp_products.rb
erp_financial_accounting-3.1.0 spec/dummy/db/migrate/20121213234218_base_products_indexes.erp_products.rb
erp_inventory-3.1.0 spec/dummy/db/migrate/20121213235623_base_products_indexes.erp_products.rb
erp_commerce-3.1.0 spec/dummy/db/migrate/20130107214963_base_products_indexes.erp_products.rb
erp_txns_and_accts-3.1.0 spec/dummy/db/migrate/20130107214869_base_products_indexes.erp_products.rb
erp_orders-3.1.0 spec/dummy/db/migrate/20130107214811_base_products_indexes.erp_products.rb
erp_products-3.1.0 spec/dummy/db/migrate/20130107214713_base_products_indexes.erp_products.rb