WIP Upgrade to Spree 1.3

This commit is contained in:
Rob H
2013-02-05 15:01:45 +11:00
parent e559870189
commit 612017f143
32 changed files with 871 additions and 298 deletions

View File

@@ -4,10 +4,11 @@ ruby "1.9.3"
gem 'rails', '3.2.11'
gem 'pg'
gem 'spree', :git => 'git://github.com/spree/spree.git', :branch => '1-1-stable'
gem 'spree', :git => 'git://github.com/spree/spree.git', :branch => '1-3-stable'
gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git'
gem 'spree_paypal_express', :git => 'git://github.com/eaterprises/spree_paypal_express.git', :branch => '1-1-stable'
gem 'spree_paypal_express', :git => 'git://github.com/spree/spree_paypal_express.git', :branch => '1-3-stable'
gem 'spree_last_address', :git => 'git://github.com/dancinglightning/spree-last-address.git'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '1-3-stable'
gem 'comfortable_mexican_sofa'

View File

@@ -21,62 +21,49 @@ GIT
aws-sdk (~> 1.3.4)
spree_core (>= 0.70.0)
GIT
remote: git://github.com/eaterprises/spree_paypal_express.git
revision: 7dd46e6e549d82c4d603f685a7cb7fbb4af0d973
branch: 1-1-stable
specs:
spree_paypal_express (1.1.0)
spree_auth (>= 1.0.0)
spree_core (>= 1.0.0)
GIT
remote: git://github.com/spree/spree.git
revision: 46691e075129fd3d7b59e296d73149a9066c1b9d
branch: 1-1-stable
revision: cbba7d046061ceb14c2947d92774ded6d7b0980e
branch: 1-3-stable
specs:
spree (1.1.3)
spree_api (= 1.1.3)
spree_auth (= 1.1.3)
spree_cmd (= 1.1.3)
spree_core (= 1.1.3)
spree_dash (= 1.1.3)
spree_promo (= 1.1.3)
spree_sample (= 1.1.3)
spree_api (1.1.3)
rabl (= 0.6.5)
spree_auth (= 1.1.3)
spree_core (= 1.1.3)
spree_auth (1.1.3)
cancan (= 1.6.7)
devise (~> 2.0.0)
spree_core (= 1.1.3)
spree_cmd (1.1.3)
spree (1.3.2.beta)
spree_api (= 1.3.2.beta)
spree_cmd (= 1.3.2.beta)
spree_core (= 1.3.2.beta)
spree_dash (= 1.3.2.beta)
spree_promo (= 1.3.2.beta)
spree_sample (= 1.3.2.beta)
spree_api (1.3.2.beta)
spree_core (= 1.3.2.beta)
versioncake (= 0.4.0)
spree_cmd (1.3.2.beta)
thor (>= 0.14.6)
spree_core (1.1.3)
activemerchant (= 1.28.0)
spree_core (1.3.2.beta)
activemerchant (~> 1.29.3)
acts_as_list (= 0.1.4)
awesome_nested_set (= 2.1.5)
aws-sdk (~> 1.3.4)
cancan (= 1.6.8)
deface (>= 0.9.0)
ffaker (~> 1.12.0)
highline (= 1.6.11)
jquery-rails (~> 2.0)
jquery-rails (~> 2.1.4)
kaminari (= 0.13.0)
nested_set (= 1.7.0)
money (= 5.0.0)
paperclip (~> 2.8)
rails (~> 3.2.8)
ransack (~> 0.6.0)
rabl (= 0.7.2)
rails (~> 3.2.11)
ransack (~> 0.7.2)
select2-rails (~> 3.2)
state_machine (= 1.1.2)
stringex (~> 1.3.2)
spree_dash (1.1.3)
spree_dash (1.3.2.beta)
httparty (~> 0.8.1)
spree_auth (= 1.1.3)
spree_core (= 1.1.3)
spree_promo (1.1.3)
spree_auth (= 1.1.3)
spree_core (= 1.1.3)
spree_sample (1.1.3)
spree_core (= 1.1.3)
spree_core (= 1.3.2.beta)
spree_promo (1.3.2.beta)
spree_core (= 1.3.2.beta)
spree_sample (1.3.2.beta)
spree_core (= 1.3.2.beta)
GIT
remote: git://github.com/spree/spree_i18n.git
@@ -86,6 +73,25 @@ GIT
i18n (~> 0.5)
spree (~> 1.1)
GIT
remote: git://github.com/spree/spree_paypal_express.git
revision: 483f6ababa9c8a1c574aad0a948c96cc21a591db
branch: 1-3-stable
specs:
spree_paypal_express (1.2.0)
spree_core (~> 1.3.0)
GIT
remote: https://github.com/spree/spree_auth_devise.git
revision: ab03a7a22740b52f96bf0311a1e9f18a99ee02f2
branch: 1-3-stable
specs:
spree_auth_devise (1.0.0)
cancan (~> 1.6.7)
devise (~> 2.2.3)
devise-encryptable (= 0.1.1)
spree_core
GEM
remote: http://rubygems.org/
specs:
@@ -106,9 +112,9 @@ GEM
active_utils (1.0.5)
activesupport (>= 2.3.11)
i18n
activemerchant (1.28.0)
activemerchant (1.29.3)
active_utils (>= 1.0.2)
activesupport (>= 2.3.11)
activesupport (>= 2.3.14)
builder (>= 2.0.0)
i18n
json (>= 1.5.1)
@@ -133,6 +139,8 @@ GEM
andand (1.3.3)
ansi (1.4.2)
arel (3.0.2)
awesome_nested_set (2.1.5)
activerecord (>= 3.0.0)
awesome_print (1.0.2)
aws-sdk (1.3.9)
httparty (~> 0.7)
@@ -144,7 +152,7 @@ GEM
httparty (>= 0.5, < 1.0)
multi_json (~> 1.0)
builder (3.0.4)
cancan (1.6.7)
cancan (1.6.8)
capybara (2.0.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@@ -154,7 +162,10 @@ GEM
xpath (~> 1.0.0)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
cocaine (0.4.2)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.1)
climate_control (>= 0.0.3, < 1.0)
coderay (1.0.7)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
@@ -179,11 +190,13 @@ GEM
deface (0.9.1)
nokogiri (~> 1.5.0)
rails (~> 3.1)
devise (2.0.4)
devise (2.2.3)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.1.1)
warden (~> 1.2.1)
devise-encryptable (0.1.1)
devise (>= 2.1.0.rc)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.4.0)
@@ -205,9 +218,9 @@ GEM
multi_xml
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.3)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
jquery-rails (2.1.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.6)
kaminari (0.13.0)
actionpack (>= 3.0.0)
@@ -232,12 +245,9 @@ GEM
i18n (~> 0.4)
json
multi_json (1.5.0)
multi_xml (0.5.1)
nested_set (1.7.0)
activerecord (>= 3.0.0)
railties (>= 3.0.0)
multi_xml (0.5.2)
nokogiri (1.5.6)
orm_adapter (0.0.7)
orm_adapter (0.4.0)
paperclip (2.8.0)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
@@ -254,13 +264,13 @@ GEM
pry-debugger (0.2.0)
debugger (~> 1.1.3)
pry (~> 0.9.9)
rabl (0.6.5)
rabl (0.7.2)
activesupport (>= 2.3.14)
multi_json (~> 1.0)
rack (1.4.4)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
@@ -281,7 +291,7 @@ GEM
thor (>= 0.14.6, < 2.0)
raindrops (0.9.0)
rake (10.0.3)
ransack (0.6.0)
ransack (0.7.2)
actionpack (~> 3.0)
activerecord (~> 3.0)
polyamorous (~> 0.5.0)
@@ -314,6 +324,8 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
select2-rails (3.2.1)
thor (~> 0.14)
selenium-webdriver (2.27.2)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
@@ -332,7 +344,7 @@ GEM
stringex (1.3.3)
therubyracer (0.10.1)
libv8 (~> 3.3.10)
thor (0.16.0)
thor (0.17.0)
tilt (1.3.3)
treetop (1.4.12)
polyglot
@@ -349,7 +361,11 @@ GEM
rack
raindrops (~> 0.7)
uuidtools (2.1.3)
warden (1.1.1)
versioncake (0.4.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
warden (1.2.1)
rack (>= 1.0)
websocket (1.0.6)
xpath (1.0.0)
@@ -382,6 +398,7 @@ DEPENDENCIES
simple_form!
spork (~> 1.0rc)
spree!
spree_auth_devise!
spree_heroku!
spree_i18n!
spree_last_address!

View File

@@ -1,18 +1,18 @@
/*--------------------------------------*/
/* Colors
/*--------------------------------------*/
$c_green: #8dba53; /* Spree green */
$c_red: #e45353; /* Error red */
$c_green: #8dba53 !default; /* Spree green */
$c_red: #e45353 !default; /* Error red */
$layout_background_color: #FFFFFF;
$title_text_color: #404042;
$body_text_color: #404042;
$link_text_color: #006066;
$layout_background_color: #FFFFFF !default;
$title_text_color: #404042 !default;
$body_text_color: #404042 !default;
$link_text_color: #00ADEE !default;
$product_background_color: #FFFFFF;
$product_title_text_color: #404042;
$product_body_text_color: #404042;
$product_link_text_color: #BBBBBB;
$product_background_color: #FFFFFF !default;
$product_title_text_color: #404042 !default;
$product_body_text_color: #404042 !default;
$product_link_text_color: #BBBBBB !default;
/*--------------------------------------*/
/* Fonts import from remote
@@ -22,37 +22,39 @@ $product_link_text_color: #BBBBBB;
/*--------------------------------------*/
/* Font families
/*--------------------------------------*/
$ff_base: 'Ubuntu', sans-serif;
$ff_base: 'Ubuntu', sans-serif !default;
/*--------------------------------------
| Font sizes
|--------------------------------------
|- Navigation
| */
$header_navigation_font_size: 14px;
$horizontal_navigation_font_size: 16px;
$main_navigation_header_font_size: 14px;
$main_navigation_font_size: 12px;
$header_navigation_font_size: 14px !default;
$horizontal_navigation_font_size: 16px !default;
$main_navigation_header_font_size: 14px !default;
$main_navigation_font_size: 12px !default;
/*|------------------------------------
|- Product Listing
| */
$product_list_name_font_size: 12px;
$product_list_price_font_size: 16px;
$product_list_header_font_size: 20px;
$product_list_search_font_size: 14px;
$product_list_name_font_size: 12px !default;
$product_list_price_font_size: 16px !default;
$product_list_header_font_size: 20px !default;
$product_list_search_font_size: 14px !default;
/*|------------------------------------
|- Product Details
| */
$product_detail_name_font_size: 24px;
$product_detail_description_font_size: 12px;
$product_detail_price_font_size: 20px;
$product_detail_title_font_size: 14px;
$product_detail_name_font_size: 24px !default;
$product_detail_description_font_size: 12px !default;
$product_detail_price_font_size: 20px !default;
$product_detail_title_font_size: 14px !default;
/*|------------------------------------
|- Basic
| */
$heading_font_size: 24px;
$sub_heading_font_size: 14px;
$button_font_size: 12px;
$input_box_font_size: 13px;
$base_font_size: 12px;
$button_border_color: rgba(0, 138, 189, .75);
$heading_font_size: 24px !default;
$sub_heading_font_size: 14px !default;
$button_font_size: 12px !default;
$input_box_font_size: 13px !default;
$base_font_size: 12px !default;
$border_color: lighten($body_text_color, 60);
$default_border: 1px solid $border_color;
$button_border_color: rgba(0, 138, 189, .75) !default;

View File

@@ -1,6 +1,6 @@
class BaseController < ApplicationController
include Spree::Core::ControllerHelpers
include Spree::Core::RespondWith
include Spree::Core::ControllerHelpers::RespondWith
helper 'spree/base'

View File

@@ -1,3 +1,4 @@
include Spree::ProductsHelper
class EnterprisesController < BaseController
def index
@enterprises = Enterprise.all

View File

@@ -19,7 +19,7 @@ Spree::OrdersController.class_eval do
def populate_order_count_on_hand
params[:products].each do |product_id, variant_id|
product = Spree::Product.find product_id
if product.count_on_hand < params[:quantity].to_i
if product.count_on_hand < params[:quantity].to_i && product.has_variants? == false
flash[:error] = "Unfortunately " + (product.count_on_hand == 0 ? "no" : "only" + product.count_on_hand.to_s ) + " units of the selected item remain."
redirect_populate_to_first_product
end
@@ -37,14 +37,14 @@ Spree::OrdersController.class_eval do
def populate_variant_attributes
if params.key? :variant_attributes
params[:variant_attributes].each do |variant_id, attributes|
@order.set_variant_attributes(Spree::Variant.find(variant_id), attributes)
current_order.set_variant_attributes(Spree::Variant.find(variant_id), attributes)
end
end
if params.key? :quantity
params[:products].each do |product_id, variant_id|
max_quantity = params[:max_quantity].to_i
@order.set_variant_attributes(Spree::Variant.find(variant_id), {:max_quantity => max_quantity})
current_order.set_variant_attributes(Spree::Variant.find(variant_id), {:max_quantity => max_quantity})
end
end
end

View File

@@ -21,7 +21,7 @@ Spree::Order.class_eval do
end
def set_variant_attributes(variant, attributes)
line_item = contains?(variant)
line_item = find_line_item_by_variant(variant)
if attributes.key?(:max_quantity) && attributes[:max_quantity].to_i < line_item.quantity
attributes[:max_quantity] = line_item.quantity

View File

@@ -1,6 +1,5 @@
<%= tab :overview, :route => :admin %>
<%= tab :orders, :payments, :creditcard_payments, :shipments, :creditcards, :return_authorizations, {:url => admin_orders_path('q[s]' => 'completed_at desc')} %>
<%= tab :products , :option_types, :properties, :prototypes, :variants, :product_properties, :taxons %>
<%= tab :reports %>
<%= tab :configurations, :general_settings, :mail_methods, :tax_categories, :zones, :states, :payment_methods, :inventory_settings, :taxonomies, :shipping_methods, :trackers, :label => 'configuration' %>
<%= tab :users %>
<%= tab :overview, :route => :admin, :icon => 'icon-dashboard' %>
<%= tab :orders, :payments, :creditcard_payments, :shipments, :credit_cards, :return_authorizations, :url => admin_orders_path('q[s]' => 'completed_at desc'), :icon => 'icon-shopping-cart' %>
<%= tab :products , :option_types, :properties, :prototypes, :variants, :product_properties, :taxons, :icon => 'icon-th-large' %>
<%= tab :reports, :icon => 'icon-file' %>
<%= tab :configurations, :general_settings, :mail_methods, :tax_categories, :zones, :states, :payment_methods, :inventory_settings, :taxonomies, :shipping_methods, :trackers, :label => 'configuration', :icon => 'icon-wrench', :url => edit_admin_general_settings_path %>

View File

@@ -1,175 +0,0 @@
<!-- Copied from Spree 1.0.3 because of the bug listed - https://github.com/spree/spree/issues/1056 for details -->
<!-- remove once noscript error is fixed -->
<div class="columns alpha six" data-hook="billing_fieldset_wrapper">
<fieldset id="billing" data-hook>
<%= form.fields_for :bill_address do |bill_form| %>
<legend><%= t(:billing_address) %></legend>
<div class="inner" data-hook="billing_inner">
<p class="field" id="bfirstname">
<%= bill_form.label :firstname, t(:first_name) %><span class="req">*</span><br />
<%= bill_form.text_field :firstname, :class => 'required' %>
</p>
<p class="field" id="blastname">
<%= bill_form.label :lastname, t(:last_name) %><span class="req">*</span><br />
<%= bill_form.text_field :lastname, :class => 'required' %>
</p>
<% if Spree::Config[:company] %>
<p class="field" id="bcompany">
<%= bill_form.label :company, t(:company) %><br />
<%= bill_form.text_field :company %>
</p>
<% end %>
<p class="field" id="baddress1">
<%= bill_form.label :address1, t(:street_address) %><span class="req">*</span><br />
<%= bill_form.text_field :address1, :class => 'required' %>
</p>
<p class="field" id="baddress2">
<%= bill_form.label :address2, t(:street_address_2) %><br />
<%= bill_form.text_field :address2 %>
</p>
<p class="field" id="bcity">
<%= bill_form.label :city, t(:city) %><span class="req">*</span><br />
<%= bill_form.text_field :city, :class => 'required' %>
</p>
<p class="field" id="bcountry">
<%= bill_form.label :country_id, t(:country) %><span class="req">*</span><br />
<span id="bcountry">
<%= bill_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required'} %>
</span>
</p>
<% if Spree::Config[:address_requires_state] %>
<p class="field" id="bstate">
<% have_states = !@order.bill_address.country.states.empty? %>
<%= bill_form.label :state, t(:state) %><span class="req">*</span><br />
<% state_elements = [
bill_form.collection_select(:state_id, @order.bill_address.country.states,
:id, :name,
{:include_blank => true},
{:class => have_states ? 'required' : 'hidden',
:disabled => !have_states}) +
bill_form.text_field(:state_name,
:class => !have_states ? 'required' : 'hidden',
:disabled => have_states)
].join.gsub('"', "'").gsub("\n", "")
%>
<%= javascript_tag do -%>
document.write("<%== state_elements %>");
<% end -%>
</p>
<noscript>
<%= bill_form.text_field :state_name, :class => 'required' %>
</noscript>
<% end %>
<p class="field" id="bzipcode">
<%= bill_form.label :zipcode, t(:zip) %><span class="req">*</span><br />
<%= bill_form.text_field :zipcode, :class => 'required' %>
</p>
<p class="field" id="bphone">
<%= bill_form.label :phone, t(:phone) %><span class="req">*</span><br />
<%= bill_form.text_field :phone, :class => 'required' %>
</p>
<% if Spree::Config[:alternative_billing_phone] %>
<p class="field" id="baltphone">
<%= bill_form.label :alternative_phone, t(:alternative_phone) %><br />
<%= bill_form.text_field :alternative_phone %>
</p>
<% end %>
</div>
<% end %>
</fieldset>
</div>
<div class="columns omega six" data-hook="shipping_fieldset_wrapper">
<fieldset id="shipping" data-hook>
<%= form.fields_for :ship_address do |ship_form| %>
<legend><%= t(:shipping_address) %></legend>
<p class="field checkbox" data-hook="use_billing">
<%= check_box_tag 'order[use_billing]', '1', (!(@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address.same_as?(@order.ship_address)) %>
<%= label_tag :order_use_billing, t(:use_billing_address), :id => 'use_billing' %>
</p>
<div class="inner" data-hook="shipping_inner">
<p class="field" id="sfirstname">
<%= ship_form.label :firstname, t(:first_name) %><span class="req">*</span><br />
<%= ship_form.text_field :firstname, :class => 'required' %>
</p>
<p class="field" id="slastname">
<%= ship_form.label :lastname, t(:last_name) %><span class="req">*</span><br />
<%= ship_form.text_field :lastname, :class => 'required' %>
</p>
<% if Spree::Config[:company] %>
<p class="field" id="scompany">
<%= ship_form.label :company, t(:company) %><br />
<%= ship_form.text_field :company %>
</p>
<% end %>
<p class="field" id="saddress1">
<%= ship_form.label :address1, t(:street_address) %><span class="req">*</span><br />
<%= ship_form.text_field :address1, :class => 'required' %>
</p>
<p class="field" id="saddress2">
<%= ship_form.label :address2, t(:street_address_2) %><br />
<%= ship_form.text_field :address2 %>
</p>
<p class="field" id="scity">
<%= ship_form.label :city, t(:city) %><span class="req">*</span><br />
<%= ship_form.text_field :city, :class => 'required' %>
</p>
<p class="field" id="scountry">
<%= ship_form.label :country_id, t(:country) %><span class="req">*</span><br />
<span id="scountry">
<%= ship_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required'} %>
</span>
</p>
<% if Spree::Config[:address_requires_state] %>
<p class="field" id="sstate">
<% have_states = !@order.ship_address.country.states.empty? %>
<%= ship_form.label :state, t(:state) %><span class="req">*</span><br />
<% state_elements = [
ship_form.collection_select(:state_id, @order.ship_address.country.states,
:id, :name,
{:include_blank => true},
{:class => have_states ? 'required' : 'hidden',
:disabled => !have_states}) +
ship_form.text_field(:state_name,
:class => !have_states ? 'required' : 'hidden',
:disabled => have_states)
].join.gsub('"', "'").gsub("\n", "")
%>
<%= javascript_tag do -%>
document.write("<%== state_elements %>");
<% end %>
</p>
<noscript>
<%= ship_form.text_field :state_name, :class => 'required' %>
</noscript>
<% end %>
<p class="field" id="szipcode">
<%= ship_form.label :zipcode, t(:zip) %><span class="req">*</span><br />
<%= ship_form.text_field :zipcode, :class => 'required' %>
</p>
<p class="field" id="sphone">
<%= ship_form.label :phone, t(:phone) %><span class="req">*</span><br />
<%= ship_form.text_field :phone, :class => 'required' %>
</p>
<% if Spree::Config[:alternative_shipping_phone] %>
<p class="field" id="saltphone">
<%= ship_form.label :alternative_phone, t(:alternative_phone) %><br />
<%= ship_form.text_field :alternative_phone %>
</p>
<% end %>
</div>
<% end %>
</fieldset>
</div>
<hr class="clear" />
<div class="form-buttons" data-hook="buttons">
<%= submit_tag t(:save_and_continue), :class => 'continue button primary' %>
</div>

View File

@@ -14,7 +14,7 @@
%h4
Total
\:
%span.order-total.grand-total= order_subtotal(@order)
%span.order-total.grand-total= @order.display_total
.links{'data-hook' => "cart_buttons"}
= button_tag :class => 'primary', :id => 'update-button' do

View File

@@ -0,0 +1,482 @@
# This migration comes from spree (originally 20120831092320)
class SpreeOneTwo < ActiveRecord::Migration
def up
# This migration is just a compressed version of all the previous
# migrations for spree_core. Do not run it if one of the core tables
# already exists. Assume the best.
return if table_exists?(:spree_addresses)
create_table :spree_activators do |t|
t.string :description
t.datetime :expires_at
t.datetime :starts_at
t.string :name
t.string :event_name
t.string :type
t.integer :usage_limit
t.string :match_policy, :default => 'all'
t.string :code
t.boolean :advertise, :default => false
t.string :path
t.timestamps
end
create_table :spree_addresses do |t|
t.string :firstname
t.string :lastname
t.string :address1
t.string :address2
t.string :city
t.string :zipcode
t.string :phone
t.string :state_name
t.string :alternative_phone
t.string :company
t.references :state
t.references :country
t.timestamps
end
add_index :spree_addresses, [:firstname], :name => 'index_addresses_on_firstname'
add_index :spree_addresses, [:lastname], :name => 'index_addresses_on_lastname'
create_table :spree_adjustments do |t|
t.references :source, :polymorphic => true
t.references :adjustable, :polymorphic => true
t.references :originator, :polymorphic => true
t.decimal :amount, :precision => 8, :scale => 2
t.string :label
t.boolean :mandatory
t.boolean :locked
t.boolean :eligible, :default => true
t.timestamps
end
add_index :spree_adjustments, [:adjustable_id], :name => 'index_adjustments_on_order_id'
create_table :spree_assets do |t|
t.references :viewable, :polymorphic => true
t.integer :attachment_width
t.integer :attachment_height
t.integer :attachment_file_size
t.integer :position
t.string :attachment_content_type
t.string :attachment_file_name
t.string :type, :limit => 75
t.datetime :attachment_updated_at
t.text :alt
end
add_index :spree_assets, [:viewable_id], :name => 'index_assets_on_viewable_id'
add_index :spree_assets, [:viewable_type, :type], :name => 'index_assets_on_viewable_type_and_type'
create_table :spree_calculators do |t|
t.string :type
t.references :calculable, :polymorphic => true
t.timestamps
end
create_table :spree_configurations do |t|
t.string :name
t.string :type, :limit => 50
t.timestamps
end
add_index :spree_configurations, [:name, :type], :name => 'index_spree_configurations_on_name_and_type'
create_table :spree_countries do |t|
t.string :iso_name
t.string :iso
t.string :iso3
t.string :name
t.integer :numcode
end
create_table :spree_credit_cards do |t|
t.string :month
t.string :year
t.string :cc_type
t.string :last_digits
t.string :first_name
t.string :last_name
t.string :start_month
t.string :start_year
t.string :issue_number
t.references :address
t.string :gateway_customer_profile_id
t.string :gateway_payment_profile_id
t.timestamps
end
create_table :spree_gateways do |t|
t.string :type
t.string :name
t.text :description
t.boolean :active, :default => true
t.string :environment, :default => 'development'
t.string :server, :default => 'test'
t.boolean :test_mode, :default => true
t.timestamps
end
create_table :spree_inventory_units do |t|
t.integer :lock_version, :default => 0
t.string :state
t.references :variant
t.references :order
t.references :shipment
t.references :return_authorization
t.timestamps
end
add_index :spree_inventory_units, [:order_id], :name => 'index_inventory_units_on_order_id'
add_index :spree_inventory_units, [:shipment_id], :name => 'index_inventory_units_on_shipment_id'
add_index :spree_inventory_units, [:variant_id], :name => 'index_inventory_units_on_variant_id'
create_table :spree_line_items do |t|
t.references :variant
t.references :order
t.integer :quantity, :null => false
t.decimal :price, :precision => 8, :scale => 2, :null => false
t.timestamps
end
add_index :spree_line_items, [:order_id], :name => 'index_spree_line_items_on_order_id'
add_index :spree_line_items, [:variant_id], :name => 'index_spree_line_items_on_variant_id'
create_table :spree_log_entries do |t|
t.references :source, :polymorphic => true
t.text :details
t.timestamps
end
create_table :spree_mail_methods do |t|
t.string :environment
t.boolean :active, :default => true
t.timestamps
end
create_table :spree_option_types do |t|
t.string :name, :limit => 100
t.string :presentation, :limit => 100
t.integer :position, :default => 0, :null => false
t.timestamps
end
create_table :spree_option_types_prototypes, :id => false do |t|
t.references :prototype
t.references :option_type
end
create_table :spree_option_values do |t|
t.integer :position
t.string :name
t.string :presentation
t.references :option_type
t.timestamps
end
create_table :spree_option_values_variants, :id => false do |t|
t.references :variant
t.references :option_value
end
add_index :spree_option_values_variants, [:variant_id, :option_value_id], :name => 'index_option_values_variants_on_variant_id_and_option_value_id'
add_index :spree_option_values_variants, [:variant_id], :name => 'index_spree_option_values_variants_on_variant_id'
create_table :spree_orders do |t|
t.string :number, :limit => 15
t.decimal :item_total, :precision => 8, :scale => 2, :default => 0.0, :null => false
t.decimal :total, :precision => 8, :scale => 2, :default => 0.0, :null => false
t.string :state
t.decimal :adjustment_total, :precision => 8, :scale => 2, :default => 0.0, :null => false
t.references :user
t.datetime :completed_at
t.references :bill_address
t.references :ship_address
t.decimal :payment_total, :precision => 8, :scale => 2, :default => 0.0
t.references :shipping_method
t.string :shipment_state
t.string :payment_state
t.string :email
t.text :special_instructions
t.timestamps
end
add_index :spree_orders, [:number], :name => 'index_spree_orders_on_number'
create_table :spree_payment_methods do |t|
t.string :type
t.string :name
t.text :description
t.boolean :active, :default => true
t.string :environment, :default => 'development'
t.datetime :deleted_at
t.string :display_on
t.timestamps
end
create_table :spree_payments do |t|
t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
t.references :order
t.references :source, :polymorphic => true
t.references :payment_method
t.string :state
t.string :response_code
t.string :avs_response
t.timestamps
end
create_table :spree_preferences do |t|
t.string :name, :limit => 100
t.references :owner, :polymorphic => true
t.text :value
t.string :key
t.string :value_type
t.timestamps
end
add_index :spree_preferences, [:key], :name => 'index_spree_preferences_on_key', :unique => true
create_table :spree_product_option_types do |t|
t.integer :position
t.references :product
t.references :option_type
t.timestamps
end
create_table :spree_product_properties do |t|
t.string :value
t.references :product
t.references :property
t.timestamps
end
add_index :spree_product_properties, [:product_id], :name => 'index_product_properties_on_product_id'
create_table :spree_products do |t|
t.string :name, :default => '', :null => false
t.text :description
t.datetime :available_on
t.datetime :deleted_at
t.string :permalink
t.string :meta_description
t.string :meta_keywords
t.references :tax_category
t.references :shipping_category
t.integer :count_on_hand, :default => 0, :null => false
t.timestamps
end
add_index :spree_products, [:available_on], :name => 'index_spree_products_on_available_on'
add_index :spree_products, [:deleted_at], :name => 'index_spree_products_on_deleted_at'
add_index :spree_products, [:name], :name => 'index_spree_products_on_name'
add_index :spree_products, [:permalink], :name => 'index_spree_products_on_permalink'
create_table :spree_products_taxons, :id => false do |t|
t.references :product
t.references :taxon
end
add_index :spree_products_taxons, [:product_id], :name => 'index_spree_products_taxons_on_product_id'
add_index :spree_products_taxons, [:taxon_id], :name => 'index_spree_products_taxons_on_taxon_id'
create_table :spree_properties do |t|
t.string :name
t.string :presentation, :null => false
t.timestamps
end
create_table :spree_properties_prototypes, :id => false do |t|
t.references :prototype
t.references :property
end
create_table :spree_prototypes do |t|
t.string :name
t.timestamps
end
create_table :spree_return_authorizations do |t|
t.string :number
t.string :state
t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
t.references :order
t.text :reason
t.timestamps
end
create_table :spree_roles do |t|
t.string :name
end
create_table :spree_roles_users, :id => false do |t|
t.references :role
t.references :user
end
add_index :spree_roles_users, [:role_id], :name => 'index_spree_roles_users_on_role_id'
add_index :spree_roles_users, [:user_id], :name => 'index_spree_roles_users_on_user_id'
create_table :spree_shipments do |t|
t.string :tracking
t.string :number
t.decimal :cost, :precision => 8, :scale => 2
t.datetime :shipped_at
t.references :order
t.references :shipping_method
t.references :address
t.string :state
t.timestamps
end
add_index :spree_shipments, [:number], :name => 'index_shipments_on_number'
create_table :spree_shipping_categories do |t|
t.string :name
t.timestamps
end
create_table :spree_shipping_methods do |t|
t.string :name
t.references :zone
t.string :display_on
t.references :shipping_category
t.boolean :match_none
t.boolean :match_all
t.boolean :match_one
t.datetime :deleted_at
t.timestamps
end
create_table :spree_state_changes do |t|
t.string :name
t.string :previous_state
t.references :stateful
t.references :user
t.string :stateful_type
t.string :next_state
t.timestamps
end
create_table :spree_states do |t|
t.string :name
t.string :abbr
t.references :country
end
create_table :spree_tax_categories do |t|
t.string :name
t.string :description
t.boolean :is_default, :default => false
t.datetime :deleted_at
t.timestamps
end
create_table :spree_tax_rates do |t|
t.decimal :amount, :precision => 8, :scale => 5
t.references :zone
t.references :tax_category
t.boolean :included_in_price, :default => false
t.timestamps
end
create_table :spree_taxonomies do |t|
t.string :name, :null => false
t.timestamps
end
create_table :spree_taxons do |t|
t.references :parent
t.integer :position, :default => 0
t.string :name, :null => false
t.string :permalink
t.references :taxonomy
t.integer :lft
t.integer :rgt
t.string :icon_file_name
t.string :icon_content_type
t.integer :icon_file_size
t.datetime :icon_updated_at
t.text :description
t.timestamps
end
add_index :spree_taxons, [:parent_id], :name => 'index_taxons_on_parent_id'
add_index :spree_taxons, [:permalink], :name => 'index_taxons_on_permalink'
add_index :spree_taxons, [:taxonomy_id], :name => 'index_taxons_on_taxonomy_id'
create_table :spree_tokenized_permissions, :force => true do |t|
t.references :permissable, :polymorphic => true
t.string :token
t.timestamps
end
add_index :spree_tokenized_permissions, [:permissable_id, :permissable_type], :name => 'index_tokenized_name_and_type'
create_table :spree_trackers do |t|
t.string :environment
t.string :analytics_id
t.boolean :active, :default => true
t.timestamps
end
create_table :spree_users do |t|
t.string :encrypted_password, :limit => 128
t.string :password_salt, :limit => 128
t.string :email
t.string :remember_token
t.string :persistence_token
t.string :reset_password_token
t.string :perishable_token
t.integer :sign_in_count, :default => 0, :null => false
t.integer :failed_attempts, :default => 0, :null => false
t.datetime :last_request_at
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
t.string :login
t.references :ship_address
t.references :bill_address
t.string :authentication_token
t.string :unlock_token
t.datetime :locked_at
t.datetime :remember_created_at
t.datetime :reset_password_sent_at
t.timestamps
end
create_table :spree_variants do |t|
t.string :sku, :default => '', :null => false
t.decimal :price, :precision => 8, :scale => 2, :null => false
t.decimal :weight, :precision => 8, :scale => 2
t.decimal :height, :precision => 8, :scale => 2
t.decimal :width, :precision => 8, :scale => 2
t.decimal :depth, :precision => 8, :scale => 2
t.datetime :deleted_at
t.boolean :is_master, :default => false
t.references :product
t.integer :count_on_hand, :default => 0, :null => false
t.decimal :cost_price, :precision => 8, :scale => 2
t.integer :position
end
add_index :spree_variants, [:product_id], :name => 'index_spree_variants_on_product_id'
create_table :spree_zone_members do |t|
t.references :zoneable, :polymorphic => true
t.references :zone
t.timestamps
end
create_table :spree_zones do |t|
t.string :name
t.string :description
t.boolean :default_tax, :default => false
t.integer :zone_members_count, :default => 0
t.timestamps
end
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20120905145253)
class AddTaxRateLabel < ActiveRecord::Migration
def change
add_column :spree_tax_rates, :name, :string
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20120905151823)
class AddToggleTaxRateDisplay < ActiveRecord::Migration
def change
add_column :spree_tax_rates, :show_rate_in_label, :boolean, :default => true
end
end

View File

@@ -0,0 +1,9 @@
# This migration comes from spree (originally 20120929093553)
class RemoveUnusedPreferenceColumns < ActiveRecord::Migration
def change
# Columns have already been removed if the application was upgraded from an older version, but must be removed from new apps.
remove_column :spree_preferences, :name if ActiveRecord::Base.connection.column_exists?(:spree_preferences, :name)
remove_column :spree_preferences, :owner_id if ActiveRecord::Base.connection.column_exists?(:spree_preferences, :owner_id)
remove_column :spree_preferences, :owner_type if ActiveRecord::Base.connection.column_exists?(:spree_preferences, :owner_type)
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121009142519)
class AddLockVersionToVariant < ActiveRecord::Migration
def change
add_column :spree_variants, :lock_version, :integer, :default => 0
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121010142909)
class AddStatesRequiredToCountries < ActiveRecord::Migration
def change
add_column :spree_countries, :states_required, :boolean,:default => true
end
end

View File

@@ -0,0 +1,7 @@
# This migration comes from spree (originally 20121012071449)
class AddOnDemandToProductAndVariant < ActiveRecord::Migration
def change
add_column :spree_products, :on_demand, :boolean, :default => false
add_column :spree_variants, :on_demand, :boolean, :default => false
end
end

View File

@@ -0,0 +1,12 @@
# This migration comes from spree (originally 20121017010007)
class RemoveNotNullConstraintFromProductsOnHand < ActiveRecord::Migration
def up
change_column :spree_products, :count_on_hand, :integer, :null => true
change_column :spree_variants, :count_on_hand, :integer, :null => true
end
def down
change_column :spree_products, :count_on_hand, :integer, :null => false
change_column :spree_variants, :count_on_hand, :integer, :null => false
end
end

View File

@@ -0,0 +1,32 @@
# This migration comes from spree (originally 20121031162139)
class SplitPricesFromVariants < ActiveRecord::Migration
def up
create_table :spree_prices do |t|
t.integer :variant_id, :null => false
t.decimal :amount, :precision => 8, :scale => 2, :null => false
t.string :currency
end
Spree::Variant.all.each do |variant|
Spree::Price.create!(
:variant_id => variant.id,
:amount => variant.price,
:currency => Spree::Config[:currency]
)
end
remove_column :spree_variants, :price
end
def down
prices = ActiveRecord::Base.connection.execute("select variant_id, amount from spree_prices")
add_column :spree_variants, :price, :decimal, :after => :sku, :scale => 2, :precision => 8
prices.each do |price|
ActiveRecord::Base.connection.execute("update spree_variants set price = #{price['amount']} where id = #{price['variant_id']}")
end
change_column :spree_variants, :price, :decimal, :after => :sku, :scale => 2, :precision => 8, :null => false
drop_table :spree_prices
end
end

View File

@@ -0,0 +1,10 @@
# This migration comes from spree (originally 20121107003422)
class RemoveNotNullFromSpreePricesAmount < ActiveRecord::Migration
def up
change_column :spree_prices, :amount, :decimal, :precision => 8, :scale => 2, :null => true
end
def down
change_column :spree_prices, :amount, :decimal, :precision => 8, :scale => 2, :null => false
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121107184631)
class AddCurrencyToLineItems < ActiveRecord::Migration
def change
add_column :spree_line_items, :currency, :string
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121107194006)
class AddCurrencyToOrders < ActiveRecord::Migration
def change
add_column :spree_orders, :currency, :string
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121109173623)
class AddCostCurrencyToVariants < ActiveRecord::Migration
def change
add_column :spree_variants, :cost_currency, :string, :after => :cost_price
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121111231553)
class RemoveDisplayOnFromPaymentMethods < ActiveRecord::Migration
def up
remove_column :spree_payment_methods, :display_on
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121124203911)
class AddPositionToTaxonomies < ActiveRecord::Migration
def change
add_column :spree_taxonomies, :position, :integer, :default => 0
end
end

View File

@@ -0,0 +1,6 @@
# This migration comes from spree (originally 20121126040517)
class AddLastIpToSpreeOrders < ActiveRecord::Migration
def change
add_column :spree_orders, :last_ip_address, :string
end
end

View File

@@ -0,0 +1,10 @@
# This migration comes from spree (originally 20130114053446)
class AddDisplayOnToSpreePaymentMethods < ActiveRecord::Migration
def self.up
add_column :spree_payment_methods, :display_on, :string
end
def self.down
remove_column :spree_payment_methods, :display_on
end
end

View File

@@ -0,0 +1,8 @@
# This migration comes from spree_api (originally 20120530054546)
class RenameApiKeyToSpreeApiKey < ActiveRecord::Migration
def change
unless defined?(User)
rename_column :spree_users, :api_key, :spree_api_key
end
end
end

View File

@@ -0,0 +1,46 @@
# This migration comes from spree_promo (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

View File

@@ -0,0 +1,8 @@
# This migration comes from spree_api (originally 20100107141738)
class AddApiKeyToSpreeUsers < ActiveRecord::Migration
def change
unless defined?(User)
add_column :spree_users, :api_key, :string, :limit => 40
end
end
end

View File

@@ -0,0 +1,30 @@
# This migration comes from spree_auth (originally 20101026184949)
class CreateUsers < ActiveRecord::Migration
def up
unless table_exists?("spree_users")
create_table "spree_users", :force => true do |t|
t.string "crypted_password", :limit => 128
t.string "salt", :limit => 128
t.string "email"
t.string "remember_token"
t.string "remember_token_expires_at"
t.string "persistence_token"
t.string "single_access_token"
t.string "perishable_token"
t.integer "login_count", :default => 0, :null => false
t.integer "failed_login_count", :default => 0, :null => false
t.datetime "last_request_at"
t.datetime "current_login_at"
t.datetime "last_login_at"
t.string "current_login_ip"
t.string "last_login_ip"
t.string "login"
t.integer "ship_address_id"
t.integer "bill_address_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "openid_identifier"
end
end
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130118031610) do
ActiveRecord::Schema.define(:version => 20130201220401) do
create_table "cms_blocks", :force => true do |t|
t.integer "page_id", :null => false
@@ -296,6 +296,7 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
t.string "iso3"
t.string "name"
t.integer "numcode"
t.boolean "states_required", :default => true
end
create_table "spree_creditcards", :force => true do |t|
@@ -351,6 +352,7 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
t.datetime "updated_at", :null => false
t.integer "max_quantity"
t.integer "shipping_method_id"
t.string "currency"
end
add_index "spree_line_items", ["order_id"], :name => "index_line_items_on_order_id"
@@ -421,6 +423,8 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
t.string "email"
t.text "special_instructions"
t.integer "distributor_id"
t.string "currency"
t.string "last_ip_address"
end
add_index "spree_orders", ["number"], :name => "index_orders_on_number"
@@ -466,9 +470,6 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
add_index "spree_pending_promotions", ["user_id"], :name => "index_spree_pending_promotions_on_user_id"
create_table "spree_preferences", :force => true do |t|
t.string "name"
t.integer "owner_id"
t.string "owner_type"
t.text "value"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
@@ -478,6 +479,12 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
add_index "spree_preferences", ["key"], :name => "index_spree_preferences_on_key", :unique => true
create_table "spree_prices", :force => true do |t|
t.integer "variant_id", :null => false
t.decimal "amount", :precision => 8, :scale => 2
t.string "currency"
end
create_table "spree_product_groups", :force => true do |t|
t.string "name"
t.string "permalink"
@@ -520,7 +527,7 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
add_index "spree_product_scopes", ["product_group_id"], :name => "index_product_scopes_on_product_group_id"
create_table "spree_products", :force => true do |t|
t.string "name", :default => "", :null => false
t.string "name", :default => "", :null => false
t.text "description"
t.datetime "available_on"
t.datetime "deleted_at"
@@ -529,12 +536,13 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
t.string "meta_keywords"
t.integer "tax_category_id"
t.integer "shipping_category_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "count_on_hand", :default => 0, :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "count_on_hand", :default => 0
t.integer "supplier_id"
t.boolean "group_buy"
t.float "group_buy_unit_size"
t.boolean "on_demand", :default => false
end
add_index "spree_products", ["available_on"], :name => "index_products_on_available_on"
@@ -702,18 +710,21 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
end
create_table "spree_tax_rates", :force => true do |t|
t.decimal "amount", :precision => 8, :scale => 5
t.decimal "amount", :precision => 8, :scale => 5
t.integer "zone_id"
t.integer "tax_category_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "included_in_price", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "included_in_price", :default => false
t.string "name"
t.boolean "show_rate_in_label", :default => true
end
create_table "spree_taxonomies", :force => true do |t|
t.string "name", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "name", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "position", :default => 0
end
create_table "spree_taxons", :force => true do |t|
@@ -779,8 +790,9 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
t.string "unlock_token"
t.datetime "locked_at"
t.datetime "remember_created_at"
t.string "api_key", :limit => 48
t.string "spree_api_key", :limit => 48
t.datetime "reset_password_sent_at"
t.string "api_key", :limit => 40
end
add_index "spree_users", ["email"], :name => "email_idx_unique", :unique => true
@@ -788,7 +800,6 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
create_table "spree_variants", :force => true do |t|
t.string "sku", :default => "", :null => false
t.decimal "price", :precision => 8, :scale => 2, :null => false
t.decimal "weight", :precision => 8, :scale => 2
t.decimal "height", :precision => 8, :scale => 2
t.decimal "width", :precision => 8, :scale => 2
@@ -796,9 +807,12 @@ ActiveRecord::Schema.define(:version => 20130118031610) do
t.datetime "deleted_at"
t.boolean "is_master", :default => false
t.integer "product_id"
t.integer "count_on_hand", :default => 0, :null => false
t.integer "count_on_hand", :default => 0
t.decimal "cost_price", :precision => 8, :scale => 2
t.integer "position"
t.integer "lock_version", :default => 0
t.boolean "on_demand", :default => false
t.string "cost_currency"
end
add_index "spree_variants", ["product_id"], :name => "index_variants_on_product_id"