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.60.4 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.50.3 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.60.3 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.1 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.0 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.60.2 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.0.rc2 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.70.RC1 db/migrate/20100426100726_create_promotion_rules.rb
spree_bushido_promo-0.80.28 db/migrate/20100426100726_create_promotion_rules.rb
spree_bushido_promo-0.80.27 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.60.1 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.60.0 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.60.0.RC1 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.50.2 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.50.1 db/migrate/20100426100726_create_promotion_rules.rb
spree_promo-0.50.0 db/migrate/20100426100726_create_promotion_rules.rb