Sha256: 012be09aa1f570f593cf918f3a55edb0961eae1e69b6e3ed3c8f3d75721c2ae1

Contents?: true

Size: 676 Bytes

Versions: 36

Compression:

Stored size: 676 Bytes

Contents

class CreatePromotionRules < ActiveRecord::Migration
  def self.up
    create_table :promotion_rules do |t|
      t.references :promotion, :user, :product_group
      t.timestamps
      t.string :type
    end
    add_index :promotion_rules, :product_group_id
    add_index :promotion_rules, :user_id

    create_table :products_promotion_rules do |t|
      t.integer :product_id, :promotion_rule_id
    end
    remove_column :products_promotion_rules, :id
    add_index :products_promotion_rules, :product_id
    add_index :products_promotion_rules, :promotion_rule_id

  end

  def self.down
    drop_table :promotion_rules
    drop_table :products_promotion_rules
  end
end

Version data entries

36 entries across 32 versions & 8 rubygems

Version Path
spree_promo-0.70.7 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.6 db/migrate/20100426100726_create_promotion_rules.rb
apispree_promo-0.0.0 db/migrate/20100426100726_create_promotion_rules.rb
My-Commerce_promo-1.1.0 db/migrate/20100426100726_create_promotion_rules.rb
My-Commerce_promo-1.0.0 db/migrate/20100426100726_create_promotion_rules.rb
MyCommerceapi-1.0.0 sandbox/db/migrate/20100426100726_create_promotion_rules.rb
MyCommerceapi-1.0.0 promo/spec/test_app/db/migrate/20100426100726_create_promotion_rules.rb
MyCommerceapi-1.0.0 promo/db/migrate/20100426100726_create_promotion_rules.rb
MyCommerce-0.0.3 sandbox/db/migrate/20100426100726_create_promotion_rules.rb
MyCommerce-0.0.3 promo/spec/test_app/db/migrate/20100426100726_create_promotion_rules.rb
MyCommerce-0.0.3 promo/db/migrate/20100426100726_create_promotion_rules.rb
rfcommerce_sandbox-0.0.3 db/migrate/20100426100726_create_promotion_rules.rb
rfcommerce_promo-0.0.3 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.60.6 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.5 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.4 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.60.5 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.3 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.2 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.50.4 db/migrate/20100426100726_create_promotion_rules.rb