Sha256: dc4fa70f5272c320e42e75606681643d57ecc8f1ebcf733b7d8171bec18a4c73

Contents?: true

Size: 1.81 KB

Versions: 11

Compression:

Stored size: 1.81 KB

Contents

# This migration comes from spree (originally 20120831092359)
class SpreePromoOneTwo < ActiveRecord::Migration
  def up
    # This migration is just a compressed migration for all previous versions of spree_promo
    return if table_exists?(:spree_products_promotion_rules)

    create_table :spree_products_promotion_rules, :id => false, :force => true do |t|
      t.references :product
      t.references :promotion_rule
    end

    add_index :spree_products_promotion_rules, [:product_id], :name => 'index_products_promotion_rules_on_product_id'
    add_index :spree_products_promotion_rules, [:promotion_rule_id], :name => 'index_products_promotion_rules_on_promotion_rule_id'

    create_table :spree_promotion_action_line_items, :force => true do |t|
      t.references :promotion_action
      t.references :variant
      t.integer    :quantity,            :default => 1
    end

    create_table :spree_promotion_actions, :force => true do |t|
      t.references :activator
      t.integer    :position
      t.string     :type
    end

    create_table :spree_promotion_rules, :force => true do |t|
      t.references :activator
      t.references :user
      t.references :product_group
      t.string     :type
      t.timestamps
    end

    add_index :spree_promotion_rules, [:product_group_id], :name => 'index_promotion_rules_on_product_group_id'
    add_index :spree_promotion_rules, [:user_id], :name => 'index_promotion_rules_on_user_id'

    create_table :spree_promotion_rules_users, :id => false, :force => true do |t|
      t.references :user
      t.references :promotion_rule
    end

    add_index :spree_promotion_rules_users, [:promotion_rule_id], :name => 'index_promotion_rules_users_on_promotion_rule_id'
    add_index :spree_promotion_rules_users, [:user_id], :name => 'index_promotion_rules_users_on_user_id'
  end
end

Version data entries

11 entries across 11 versions & 6 rubygems

Version Path
spree_order_reporting-0.0.3 spec/dummy/db/migrate/20160708163030_spree_promo_one_two.spree.rb
sprangular-0.1.0 spec/dummy/db/migrate/20140814105632_spree_promo_one_two.spree.rb
sprangular-0.0.1 spec/dummy/db/migrate/20140814105632_spree_promo_one_two.spree.rb
spree_mercado_pago-0.2.3 spec/dummy/db/migrate/20141204014625_spree_promo_one_two.spree.rb
spree_mercado_pago-0.2.2 spec/dummy/db/migrate/20141204014625_spree_promo_one_two.spree.rb
spree_mercado_pago-0.2.1 spec/dummy/db/migrate/20141112193408_spree_promo_one_two.spree.rb
spree_mercado_pago-0.2.0 spec/dummy/db/migrate/20141112193408_spree_promo_one_two.spree.rb
spree_mercado_pago_payment_method-0.2.0 spec/dummy/db/migrate/20141112193408_spree_promo_one_two.spree.rb
spree_bitpay-1.0.2 spec/dummy/db/migrate/20141002181205_spree_promo_one_two.spree.rb
bcms_spree-0.0.2 test/dummy/db/migrate/20140915222544_spree_promo_one_two.spree.rb
bcms_spree-0.0.1 test/dummy/db/migrate/20140915222544_spree_promo_one_two.spree.rb