Sha256: 6b9242d155488e592e15b1d2018188844f8ad3f91760feaad2f8dc2245835b00

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

# This migration comes from spree (originally 20150909123605)
class CreateVariantPropertiesAndRules < ActiveRecord::Migration
  def change
    create_table :spree_variant_property_rules do |t|
      t.references :product
      t.timestamps null: false
    end

    add_index :spree_variant_property_rules, :product_id

    create_table :spree_variant_property_rule_conditions do |t|
      t.references :option_value
      t.references :variant_property_rule
      t.timestamps null: false
    end

    add_index :spree_variant_property_rule_conditions, [:variant_property_rule_id, :option_value_id], name: "index_spree_variant_prop_rule_conditions_on_rule_and_optval"

    create_table :spree_variant_property_rule_values do |t|
      t.text       :value
      t.integer    :position, default: 0
      t.references :property
      t.references :variant_property_rule
    end

    add_index :spree_variant_property_rule_values, :property_id
    add_index :spree_variant_property_rule_values, :variant_property_rule_id, name: "index_spree_variant_property_rule_values_on_rule"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_order_reporting-0.0.2 spec/dummy/db/migrate/20160707103620_create_variant_properties_and_rules.spree.rb
spree_order_reporting-0.0.1 spec/dummy/db/migrate/20160706112572_create_variant_properties_and_rules.spree.rb