Sha256: 67ea782faa2f2e128b1b1e3ed8e807ad59449e61abff65f7b6caa426fe02afb3

Contents?: true

Size: 734 Bytes

Versions: 4

Compression:

Stored size: 734 Bytes

Contents

# This migration comes from spree_promo (originally 20100426100726)
class CreatePromotionRules < ActiveRecord::Migration
  def up
    create_table :promotion_rules do |t|
      t.references :promotion, :user, :product_group
      t.string :type

      t.timestamps
    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 down
    drop_table :promotion_rules
    drop_table :products_promotion_rules
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
datashift_spree-0.3.0 spec/sandbox/db/migrate/20121023154469_create_promotion_rules.spree_promo.rb
datashift_spree-0.2.1 spec/sandbox/db/migrate/20121015151262_create_promotion_rules.spree_promo.rb
datashift_spree-0.2.0 spec/sandbox/db/migrate/20120925192830_create_promotion_rules.spree_promo.rb
datashift_spree-0.1.0 spec/sandbox/db/migrate/20120918081561_create_promotion_rules.spree_promo.rb