spree_flat_in_range 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +26 -0
- data/README.md +39 -0
- data/app/models/spree/calculator/flat_in_range.rb +21 -0
- data/config/locales/en.yml +5 -0
- data/lib/spree_flat_in_range.rb +21 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/admin/all.js +10 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/javascripts/store/all.js +10 -0
- data/spec/dummy/app/assets/stylesheets/admin/all.css +11 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/assets/stylesheets/store/all.css +11 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +60 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/database.yml +18 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/spree.rb +12 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/spree.yml +2 -0
- data/spec/dummy/db/dummy_test +0 -0
- data/spec/dummy/db/migrate/20120218160357_spree_zero_nine_zero.rb +389 -0
- data/spec/dummy/db/migrate/20120218160358_create_indexes_for_inventory_units.rb +6 -0
- data/spec/dummy/db/migrate/20120218160359_add_count_on_hand_to_variants_and_products.rb +49 -0
- data/spec/dummy/db/migrate/20120218160360_change_taxons_to_nested_set.rb +46 -0
- data/spec/dummy/db/migrate/20120218160361_move_to_configurable_gateways.rb +54 -0
- data/spec/dummy/db/migrate/20120218160362_product_groups_and_scopes.rb +18 -0
- data/spec/dummy/db/migrate/20120218160363_add_open_id_authentication_tables.rb +15 -0
- data/spec/dummy/db/migrate/20120218160364_add_openid_field_to_users.rb +24 -0
- data/spec/dummy/db/migrate/20120218160365_change_preference_value_type.rb +10 -0
- data/spec/dummy/db/migrate/20120218160366_create_billing_integrations.rb +12 -0
- data/spec/dummy/db/migrate/20120218160367_charge_refactoring.rb +39 -0
- data/spec/dummy/db/migrate/20120218160368_add_some_indexes.rb +11 -0
- data/spec/dummy/db/migrate/20120218160369_checkout_state_machine.rb +5 -0
- data/spec/dummy/db/migrate/20120218160370_state_for_shipments.rb +5 -0
- data/spec/dummy/db/migrate/20120218160371_make_state_events_polymorphic.rb +12 -0
- data/spec/dummy/db/migrate/20120218160372_ship_address_id_for_checkouts.rb +5 -0
- data/spec/dummy/db/migrate/20120218160373_shipping_method_id_for_checkouts.rb +5 -0
- data/spec/dummy/db/migrate/20120218160374_creditcard_last_four_digits.rb +14 -0
- data/spec/dummy/db/migrate/20120218160375_populate_legacy_shipment_state.rb +15 -0
- data/spec/dummy/db/migrate/20120218160376_add_cost_price.rb +5 -0
- data/spec/dummy/db/migrate/20120218160377_shipment_id_for_inventory_units.rb +25 -0
- data/spec/dummy/db/migrate/20120218160378_cim_fields_for_creditcards.rb +6 -0
- data/spec/dummy/db/migrate/20120218160379_create_return_authorizations.rb +12 -0
- data/spec/dummy/db/migrate/20120218160380_add_return_authorization_to_inventory_units.rb +5 -0
- data/spec/dummy/db/migrate/20120218160381_create_trackers.rb +10 -0
- data/spec/dummy/db/migrate/20120218160382_creditcard_id_for_creditcard_txns.rb +5 -0
- data/spec/dummy/db/migrate/20120218160383_original_creditcard_txn_id_for_creditcard_txns.rb +5 -0
- data/spec/dummy/db/migrate/20120218160384_add_test_mode_to_billing_integration.rb +6 -0
- data/spec/dummy/db/migrate/20120218160385_create_products_product_groups.rb +8 -0
- data/spec/dummy/db/migrate/20120218160386_create_payment_methods.rb +16 -0
- data/spec/dummy/db/migrate/20120218160387_polymorphic_payments.rb +42 -0
- data/spec/dummy/db/migrate/20120218160388_change_payments_payment_method_to_belongs_to.rb +11 -0
- data/spec/dummy/db/migrate/20120218160389_assign_creditcard_txns_to_payment.rb +23 -0
- data/spec/dummy/db/migrate/20120218160390_sti_for_transactions.rb +15 -0
- data/spec/dummy/db/migrate/20120218160391_drop_billing_integrations.rb +16 -0
- data/spec/dummy/db/migrate/20120218160392_deleted_at_for_payment_methods.rb +14 -0
- data/spec/dummy/db/migrate/20120218160393_add_adjustments_index.rb +6 -0
- data/spec/dummy/db/migrate/20120218160394_fix_by_popularity.rb +9 -0
- data/spec/dummy/db/migrate/20120218160395_add_alt_text_to_images.rb +5 -0
- data/spec/dummy/db/migrate/20120218160396_fix_existing_coupon_credits.rb +13 -0
- data/spec/dummy/db/migrate/20120218160397_add_display_to_payment_methods.rb +5 -0
- data/spec/dummy/db/migrate/20120218160398_add_addresses_checkouts_indexes.rb +8 -0
- data/spec/dummy/db/migrate/20120218160399_add_icon_to_taxons.rb +17 -0
- data/spec/dummy/db/migrate/20120218160400_add_description_to_taxons.rb +11 -0
- data/spec/dummy/db/migrate/20120218160401_index_for_shipments_number.rb +5 -0
- data/spec/dummy/db/migrate/20120218160402_add_index_on_users_persistence_token.rb +5 -0
- data/spec/dummy/db/migrate/20120218160403_add_default_to_tax_categories.rb +5 -0
- data/spec/dummy/db/migrate/20120218160404_add_display_to_shipping_methods.rb +5 -0
- data/spec/dummy/db/migrate/20120218160405_rename_payment_method_display.rb +5 -0
- data/spec/dummy/db/migrate/20120218160406_rename_preferences_field.rb +5 -0
- data/spec/dummy/db/migrate/20120218160407_add_guest_flag.rb +5 -0
- data/spec/dummy/db/migrate/20120218160408_drop_order_token.rb +9 -0
- data/spec/dummy/db/migrate/20120218160409_payments_state_and_assigned_to_order_only.rb +14 -0
- data/spec/dummy/db/migrate/20120218160410_create_address_keys_for_order.rb +6 -0
- data/spec/dummy/db/migrate/20120218160411_payment_total_for_orders.rb +5 -0
- data/spec/dummy/db/migrate/20120218160412_shipping_method_id_for_orders.rb +5 -0
- data/spec/dummy/db/migrate/20120218160413_add_shipment_and_payment_state.rb +6 -0
- data/spec/dummy/db/migrate/20120218160414_refactor_adjustments.rb +29 -0
- data/spec/dummy/db/migrate/20120218160415_response_code_and_avs_response_for_payments.rb +6 -0
- data/spec/dummy/db/migrate/20120218160416_change_guest_flag_to_anonymous.rb +5 -0
- data/spec/dummy/db/migrate/20120218160417_email_for_orders.rb +5 -0
- data/spec/dummy/db/migrate/20120218160418_create_mail_methods.rb +10 -0
- data/spec/dummy/db/migrate/20120218160419_rename_frozen_to_locked.rb +5 -0
- data/spec/dummy/db/migrate/20120218160420_move_special_instructions_to_orders.rb +10 -0
- data/spec/dummy/db/migrate/20120218160421_create_log_entries.rb +11 -0
- data/spec/dummy/db/migrate/20120218160422_migrate_transactions_to_payment_state.rb +98 -0
- data/spec/dummy/db/migrate/20120218160423_delete_in_progress_orders.rb +19 -0
- data/spec/dummy/db/migrate/20120218160424_migrate_checkout_to_orders.rb +23 -0
- data/spec/dummy/db/migrate/20120218160425_remove_shipped_state.rb +12 -0
- data/spec/dummy/db/migrate/20120218160426_prevent_nil_payment_total.rb +8 -0
- data/spec/dummy/db/migrate/20120218160427_prevent_nil_email.rb +9 -0
- data/spec/dummy/db/migrate/20120218160428_generate_anonymous_users.rb +20 -0
- data/spec/dummy/db/migrate/20120218160429_update_order_state.rb +12 -0
- data/spec/dummy/db/migrate/20120218160430_cleanup_legacy_tables.rb +11 -0
- data/spec/dummy/db/migrate/20120218160431_remove_number_and_cvv_from_credicard.rb +11 -0
- data/spec/dummy/db/migrate/20120218160432_drop_anonymous_field_for_user.rb +9 -0
- data/spec/dummy/db/migrate/20120218160433_renamed_rma_cancelled_state.rb +9 -0
- data/spec/dummy/db/migrate/20120218160434_fix_problematic_index_names.rb +13 -0
- data/spec/dummy/db/migrate/20120218160435_add_position_to_variants.rb +5 -0
- data/spec/dummy/db/migrate/20120218160436_add_next_state_to_state_events.rb +5 -0
- data/spec/dummy/db/migrate/20120218160437_add_position_to_option_types.rb +5 -0
- data/spec/dummy/db/migrate/20120218160438_remove_trailing_slashes_in_taxon_permalinks.rb +19 -0
- data/spec/dummy/db/migrate/20120218160439_create_activators.rb +14 -0
- data/spec/dummy/db/migrate/20120218160440_eligible_for_adjustments.rb +5 -0
- data/spec/dummy/db/migrate/20120218160441_namespace_top_level_models.rb +52 -0
- data/spec/dummy/db/migrate/20120218160442_migrate_namespaced_polymorphic_models.rb +52 -0
- data/spec/dummy/db/migrate/20120218160443_make_adjustments_polymorphic.rb +9 -0
- data/spec/dummy/db/migrate/20120218160444_add_company_to_addresses.rb +5 -0
- data/spec/dummy/db/migrate/20120218160445_add_inc_tax_to_tax_rates.rb +5 -0
- data/spec/dummy/db/migrate/20120218160446_rename_inc_price_attribute.rb +5 -0
- data/spec/dummy/db/migrate/20120218160447_add_default_tax_zone.rb +5 -0
- data/spec/dummy/db/migrate/20120218160448_associate_shipping_methods_and_shipping_categories.rb +7 -0
- data/spec/dummy/db/migrate/20120218160449_add_match_rules_to_shipping_methods.rb +7 -0
- data/spec/dummy/db/migrate/20120218160450_new_preferences.rb +48 -0
- data/spec/dummy/db/migrate/20120218160451_add_deleted_at_to_tax_category.rb +5 -0
- data/spec/dummy/db/schema.rb +553 -0
- data/spec/dummy/db/seeds.rb +11 -0
- data/spec/dummy/log/test.log +1136 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/dummy/script/rails +6 -0
- data/spec/flat_in_range_spec.rb +56 -0
- data/spec/spec_helper.rb +32 -0
- metadata +428 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
class MakeAdjustmentsPolymorphic < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def change
|
4
|
+
add_column :spree_adjustments, :adjustable_type, :string
|
5
|
+
rename_column :spree_adjustments, :order_id, :adjustable_id
|
6
|
+
execute "UPDATE spree_adjustments SET adjustable_type = 'Spree::Order'"
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spree/core/preference_rescue'
|
2
|
+
|
3
|
+
class NewPreferences < ActiveRecord::Migration
|
4
|
+
|
5
|
+
def up
|
6
|
+
add_column :spree_preferences, :key, :string
|
7
|
+
add_column :spree_preferences, :value_type, :string
|
8
|
+
add_index :spree_preferences, :key, :unique => true
|
9
|
+
|
10
|
+
remove_index :spree_preferences, :name => 'ix_prefs_on_owner_attr_pref'
|
11
|
+
|
12
|
+
# remove old constraints for migration
|
13
|
+
change_column :spree_preferences, :name, :string, :null => true
|
14
|
+
change_column :spree_preferences, :owner_id, :integer, :null => true
|
15
|
+
change_column :spree_preferences, :owner_type, :string, :null => true
|
16
|
+
change_column :spree_preferences, :group_id, :integer, :null => true
|
17
|
+
change_column :spree_preferences, :group_type, :string, :null => true
|
18
|
+
|
19
|
+
cfgs = execute("select id, type from spree_configurations").to_a
|
20
|
+
execute("select id, owner_id, name from spree_preferences where owner_type = 'Spree::Configuration'").each do |pref|
|
21
|
+
configuration = cfgs.detect { |c| c[0].to_s == pref[1].to_s }
|
22
|
+
|
23
|
+
value_type = configuration[1].constantize.new.send "preferred_#{pref[2]}_type" rescue 'string'
|
24
|
+
|
25
|
+
execute "UPDATE spree_preferences set `key` = '#{configuration[1].underscore}/#{pref[2]}', `value_type` = '#{value_type}' where id = #{pref[0]}" rescue nil
|
26
|
+
end
|
27
|
+
|
28
|
+
# remove orphaned calculator preferences
|
29
|
+
Spree::Preference.where(:owner_type => 'Spree::Calculator').each do |preference|
|
30
|
+
preference.destroy unless Spree::Calculator.exists? preference.owner_id
|
31
|
+
end
|
32
|
+
|
33
|
+
Spree::PreferenceRescue.try
|
34
|
+
|
35
|
+
Spree::Preference.where(:value_type => nil).update_all(:value_type => 'string')
|
36
|
+
end
|
37
|
+
|
38
|
+
def down
|
39
|
+
remove_column :spree_preferences, :key
|
40
|
+
remove_column :spree_preferences, :value_type
|
41
|
+
|
42
|
+
add_column :spree_preferences, :name, :string
|
43
|
+
add_column :spree_preferences, :owner_id, :integer
|
44
|
+
add_column :spree_preferences, :owner_type, :string
|
45
|
+
add_column :spree_preferences, :group_id, :integer
|
46
|
+
add_column :spree_preferences, :group_type, :string
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,553 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
+
#
|
11
|
+
# It's strongly recommended to check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(:version => 20120218160451) do
|
14
|
+
|
15
|
+
create_table "coupons", :force => true do |t|
|
16
|
+
t.string "code"
|
17
|
+
t.string "description"
|
18
|
+
t.integer "usage_limit"
|
19
|
+
t.boolean "combine"
|
20
|
+
t.datetime "expires_at"
|
21
|
+
t.datetime "starts_at"
|
22
|
+
t.datetime "created_at"
|
23
|
+
t.datetime "updated_at"
|
24
|
+
end
|
25
|
+
|
26
|
+
create_table "spree_activators", :force => true do |t|
|
27
|
+
t.string "description"
|
28
|
+
t.datetime "expires_at"
|
29
|
+
t.datetime "created_at"
|
30
|
+
t.datetime "updated_at"
|
31
|
+
t.datetime "starts_at"
|
32
|
+
t.string "name"
|
33
|
+
t.string "event_name"
|
34
|
+
t.string "type"
|
35
|
+
end
|
36
|
+
|
37
|
+
create_table "spree_addresses", :force => true do |t|
|
38
|
+
t.string "firstname"
|
39
|
+
t.string "lastname"
|
40
|
+
t.string "address1"
|
41
|
+
t.string "address2"
|
42
|
+
t.string "city"
|
43
|
+
t.string "zipcode"
|
44
|
+
t.string "phone"
|
45
|
+
t.string "state_name"
|
46
|
+
t.string "alternative_phone"
|
47
|
+
t.integer "state_id"
|
48
|
+
t.integer "country_id"
|
49
|
+
t.datetime "created_at"
|
50
|
+
t.datetime "updated_at"
|
51
|
+
t.string "company"
|
52
|
+
end
|
53
|
+
|
54
|
+
add_index "spree_addresses", ["firstname"], :name => "index_addresses_on_firstname"
|
55
|
+
add_index "spree_addresses", ["lastname"], :name => "index_addresses_on_lastname"
|
56
|
+
|
57
|
+
create_table "spree_adjustments", :force => true do |t|
|
58
|
+
t.integer "source_id"
|
59
|
+
t.decimal "amount"
|
60
|
+
t.string "label"
|
61
|
+
t.string "source_type"
|
62
|
+
t.integer "adjustable_id"
|
63
|
+
t.datetime "created_at"
|
64
|
+
t.datetime "updated_at"
|
65
|
+
t.boolean "mandatory"
|
66
|
+
t.boolean "locked"
|
67
|
+
t.integer "originator_id"
|
68
|
+
t.string "originator_type"
|
69
|
+
t.boolean "eligible", :default => true
|
70
|
+
t.string "adjustable_type"
|
71
|
+
end
|
72
|
+
|
73
|
+
add_index "spree_adjustments", ["adjustable_id"], :name => "index_adjustments_on_order_id"
|
74
|
+
|
75
|
+
create_table "spree_assets", :force => true do |t|
|
76
|
+
t.integer "viewable_id"
|
77
|
+
t.integer "attachment_width"
|
78
|
+
t.integer "attachment_height"
|
79
|
+
t.integer "attachment_size"
|
80
|
+
t.integer "position"
|
81
|
+
t.string "viewable_type", :limit => 50
|
82
|
+
t.string "attachment_content_type"
|
83
|
+
t.string "attachment_file_name"
|
84
|
+
t.string "type", :limit => 75
|
85
|
+
t.datetime "attachment_updated_at"
|
86
|
+
t.text "alt"
|
87
|
+
end
|
88
|
+
|
89
|
+
add_index "spree_assets", ["viewable_id"], :name => "index_assets_on_viewable_id"
|
90
|
+
add_index "spree_assets", ["viewable_type", "type"], :name => "index_assets_on_viewable_type_and_type"
|
91
|
+
|
92
|
+
create_table "spree_calculators", :force => true do |t|
|
93
|
+
t.string "type"
|
94
|
+
t.integer "calculable_id", :null => false
|
95
|
+
t.string "calculable_type", :null => false
|
96
|
+
t.datetime "created_at"
|
97
|
+
t.datetime "updated_at"
|
98
|
+
end
|
99
|
+
|
100
|
+
create_table "spree_configurations", :force => true do |t|
|
101
|
+
t.string "name"
|
102
|
+
t.string "type", :limit => 50
|
103
|
+
t.datetime "created_at"
|
104
|
+
t.datetime "updated_at"
|
105
|
+
end
|
106
|
+
|
107
|
+
add_index "spree_configurations", ["name", "type"], :name => "index_configurations_on_name_and_type"
|
108
|
+
|
109
|
+
create_table "spree_countries", :force => true do |t|
|
110
|
+
t.string "iso_name"
|
111
|
+
t.string "iso"
|
112
|
+
t.string "iso3"
|
113
|
+
t.string "name"
|
114
|
+
t.integer "numcode"
|
115
|
+
end
|
116
|
+
|
117
|
+
create_table "spree_creditcards", :force => true do |t|
|
118
|
+
t.string "month"
|
119
|
+
t.string "year"
|
120
|
+
t.string "cc_type"
|
121
|
+
t.string "last_digits"
|
122
|
+
t.string "first_name"
|
123
|
+
t.string "last_name"
|
124
|
+
t.string "start_month"
|
125
|
+
t.string "start_year"
|
126
|
+
t.string "issue_number"
|
127
|
+
t.integer "address_id"
|
128
|
+
t.datetime "created_at"
|
129
|
+
t.datetime "updated_at"
|
130
|
+
t.string "gateway_customer_profile_id"
|
131
|
+
t.string "gateway_payment_profile_id"
|
132
|
+
end
|
133
|
+
|
134
|
+
create_table "spree_gateways", :force => true do |t|
|
135
|
+
t.string "type"
|
136
|
+
t.string "name"
|
137
|
+
t.text "description"
|
138
|
+
t.boolean "active", :default => true
|
139
|
+
t.string "environment", :default => "development"
|
140
|
+
t.string "server", :default => "test"
|
141
|
+
t.boolean "test_mode", :default => true
|
142
|
+
t.datetime "created_at"
|
143
|
+
t.datetime "updated_at"
|
144
|
+
end
|
145
|
+
|
146
|
+
create_table "spree_inventory_units", :force => true do |t|
|
147
|
+
t.integer "lock_version", :default => 0
|
148
|
+
t.string "state"
|
149
|
+
t.integer "variant_id"
|
150
|
+
t.integer "order_id"
|
151
|
+
t.datetime "created_at"
|
152
|
+
t.datetime "updated_at"
|
153
|
+
t.integer "shipment_id"
|
154
|
+
t.integer "return_authorization_id"
|
155
|
+
end
|
156
|
+
|
157
|
+
add_index "spree_inventory_units", ["order_id"], :name => "index_inventory_units_on_order_id"
|
158
|
+
add_index "spree_inventory_units", ["shipment_id"], :name => "index_inventory_units_on_shipment_id"
|
159
|
+
add_index "spree_inventory_units", ["variant_id"], :name => "index_inventory_units_on_variant_id"
|
160
|
+
|
161
|
+
create_table "spree_line_items", :force => true do |t|
|
162
|
+
t.integer "order_id"
|
163
|
+
t.integer "variant_id"
|
164
|
+
t.integer "quantity", :null => false
|
165
|
+
t.decimal "price", :precision => 8, :scale => 2, :null => false
|
166
|
+
t.datetime "created_at"
|
167
|
+
t.datetime "updated_at"
|
168
|
+
end
|
169
|
+
|
170
|
+
add_index "spree_line_items", ["order_id"], :name => "index_line_items_on_order_id"
|
171
|
+
add_index "spree_line_items", ["variant_id"], :name => "index_line_items_on_variant_id"
|
172
|
+
|
173
|
+
create_table "spree_log_entries", :force => true do |t|
|
174
|
+
t.integer "source_id"
|
175
|
+
t.string "source_type"
|
176
|
+
t.text "details"
|
177
|
+
t.datetime "created_at"
|
178
|
+
t.datetime "updated_at"
|
179
|
+
end
|
180
|
+
|
181
|
+
create_table "spree_mail_methods", :force => true do |t|
|
182
|
+
t.string "environment"
|
183
|
+
t.boolean "active", :default => true
|
184
|
+
t.datetime "created_at"
|
185
|
+
t.datetime "updated_at"
|
186
|
+
end
|
187
|
+
|
188
|
+
create_table "spree_option_types", :force => true do |t|
|
189
|
+
t.string "name", :limit => 100
|
190
|
+
t.string "presentation", :limit => 100
|
191
|
+
t.datetime "created_at"
|
192
|
+
t.datetime "updated_at"
|
193
|
+
t.integer "position", :default => 0, :null => false
|
194
|
+
end
|
195
|
+
|
196
|
+
create_table "spree_option_types_prototypes", :id => false, :force => true do |t|
|
197
|
+
t.integer "prototype_id"
|
198
|
+
t.integer "option_type_id"
|
199
|
+
end
|
200
|
+
|
201
|
+
create_table "spree_option_values", :force => true do |t|
|
202
|
+
t.integer "position"
|
203
|
+
t.string "name"
|
204
|
+
t.string "presentation"
|
205
|
+
t.integer "option_type_id"
|
206
|
+
t.datetime "created_at"
|
207
|
+
t.datetime "updated_at"
|
208
|
+
end
|
209
|
+
|
210
|
+
create_table "spree_option_values_variants", :id => false, :force => true do |t|
|
211
|
+
t.integer "variant_id"
|
212
|
+
t.integer "option_value_id"
|
213
|
+
end
|
214
|
+
|
215
|
+
add_index "spree_option_values_variants", ["variant_id", "option_value_id"], :name => "index_option_values_variants_on_variant_id_and_option_value_id"
|
216
|
+
add_index "spree_option_values_variants", ["variant_id"], :name => "index_option_values_variants_on_variant_id"
|
217
|
+
|
218
|
+
create_table "spree_orders", :force => true do |t|
|
219
|
+
t.string "number", :limit => 15
|
220
|
+
t.decimal "item_total", :default => 0.0, :null => false
|
221
|
+
t.decimal "total", :default => 0.0, :null => false
|
222
|
+
t.string "state"
|
223
|
+
t.decimal "adjustment_total", :default => 0.0, :null => false
|
224
|
+
t.decimal "credit_total", :default => 0.0, :null => false
|
225
|
+
t.integer "user_id"
|
226
|
+
t.datetime "created_at"
|
227
|
+
t.datetime "updated_at"
|
228
|
+
t.datetime "completed_at"
|
229
|
+
t.integer "bill_address_id"
|
230
|
+
t.integer "ship_address_id"
|
231
|
+
t.decimal "payment_total", :precision => 8, :scale => 2, :default => 0.0
|
232
|
+
t.integer "shipping_method_id"
|
233
|
+
t.string "shipment_state"
|
234
|
+
t.string "payment_state"
|
235
|
+
t.string "email"
|
236
|
+
t.text "special_instructions"
|
237
|
+
end
|
238
|
+
|
239
|
+
add_index "spree_orders", ["number"], :name => "index_orders_on_number"
|
240
|
+
|
241
|
+
create_table "spree_payment_methods", :force => true do |t|
|
242
|
+
t.string "type"
|
243
|
+
t.string "name"
|
244
|
+
t.text "description"
|
245
|
+
t.boolean "active", :default => true
|
246
|
+
t.string "environment", :default => "development"
|
247
|
+
t.datetime "created_at"
|
248
|
+
t.datetime "updated_at"
|
249
|
+
t.datetime "deleted_at"
|
250
|
+
t.string "display_on"
|
251
|
+
end
|
252
|
+
|
253
|
+
create_table "spree_payments", :force => true do |t|
|
254
|
+
t.decimal "amount", :default => 0.0, :null => false
|
255
|
+
t.integer "order_id"
|
256
|
+
t.datetime "created_at"
|
257
|
+
t.datetime "updated_at"
|
258
|
+
t.integer "source_id"
|
259
|
+
t.string "source_type"
|
260
|
+
t.integer "payment_method_id"
|
261
|
+
t.string "state"
|
262
|
+
t.string "response_code"
|
263
|
+
t.string "avs_response"
|
264
|
+
end
|
265
|
+
|
266
|
+
create_table "spree_preferences", :force => true do |t|
|
267
|
+
t.string "name", :limit => 100
|
268
|
+
t.integer "owner_id", :limit => 30
|
269
|
+
t.string "owner_type", :limit => 50
|
270
|
+
t.integer "group_id"
|
271
|
+
t.string "group_type", :limit => 50
|
272
|
+
t.text "value", :limit => 255
|
273
|
+
t.datetime "created_at"
|
274
|
+
t.datetime "updated_at"
|
275
|
+
t.string "key"
|
276
|
+
t.string "value_type"
|
277
|
+
end
|
278
|
+
|
279
|
+
add_index "spree_preferences", ["key"], :name => "index_spree_preferences_on_key", :unique => true
|
280
|
+
|
281
|
+
create_table "spree_product_groups", :force => true do |t|
|
282
|
+
t.string "name"
|
283
|
+
t.string "permalink"
|
284
|
+
t.string "order"
|
285
|
+
end
|
286
|
+
|
287
|
+
add_index "spree_product_groups", ["name"], :name => "index_product_groups_on_name"
|
288
|
+
add_index "spree_product_groups", ["permalink"], :name => "index_product_groups_on_permalink"
|
289
|
+
|
290
|
+
create_table "spree_product_groups_products", :id => false, :force => true do |t|
|
291
|
+
t.integer "product_id"
|
292
|
+
t.integer "product_group_id"
|
293
|
+
end
|
294
|
+
|
295
|
+
create_table "spree_product_option_types", :force => true do |t|
|
296
|
+
t.integer "position"
|
297
|
+
t.integer "product_id"
|
298
|
+
t.integer "option_type_id"
|
299
|
+
t.datetime "created_at"
|
300
|
+
t.datetime "updated_at"
|
301
|
+
end
|
302
|
+
|
303
|
+
create_table "spree_product_properties", :force => true do |t|
|
304
|
+
t.string "value"
|
305
|
+
t.integer "product_id"
|
306
|
+
t.integer "property_id"
|
307
|
+
t.datetime "created_at"
|
308
|
+
t.datetime "updated_at"
|
309
|
+
end
|
310
|
+
|
311
|
+
add_index "spree_product_properties", ["product_id"], :name => "index_product_properties_on_product_id"
|
312
|
+
|
313
|
+
create_table "spree_product_scopes", :force => true do |t|
|
314
|
+
t.string "name"
|
315
|
+
t.text "arguments"
|
316
|
+
t.integer "product_group_id"
|
317
|
+
end
|
318
|
+
|
319
|
+
add_index "spree_product_scopes", ["name"], :name => "index_product_scopes_on_name"
|
320
|
+
add_index "spree_product_scopes", ["product_group_id"], :name => "index_product_scopes_on_product_group_id"
|
321
|
+
|
322
|
+
create_table "spree_products", :force => true do |t|
|
323
|
+
t.string "name", :default => "", :null => false
|
324
|
+
t.text "description"
|
325
|
+
t.datetime "available_on"
|
326
|
+
t.datetime "deleted_at"
|
327
|
+
t.string "permalink"
|
328
|
+
t.string "meta_description"
|
329
|
+
t.string "meta_keywords"
|
330
|
+
t.integer "tax_category_id"
|
331
|
+
t.integer "shipping_category_id"
|
332
|
+
t.datetime "created_at"
|
333
|
+
t.datetime "updated_at"
|
334
|
+
t.integer "count_on_hand", :default => 0, :null => false
|
335
|
+
end
|
336
|
+
|
337
|
+
add_index "spree_products", ["available_on"], :name => "index_products_on_available_on"
|
338
|
+
add_index "spree_products", ["deleted_at"], :name => "index_products_on_deleted_at"
|
339
|
+
add_index "spree_products", ["name"], :name => "index_products_on_name"
|
340
|
+
add_index "spree_products", ["permalink"], :name => "index_products_on_permalink"
|
341
|
+
|
342
|
+
create_table "spree_products_taxons", :id => false, :force => true do |t|
|
343
|
+
t.integer "product_id"
|
344
|
+
t.integer "taxon_id"
|
345
|
+
end
|
346
|
+
|
347
|
+
add_index "spree_products_taxons", ["product_id"], :name => "index_products_taxons_on_product_id"
|
348
|
+
add_index "spree_products_taxons", ["taxon_id"], :name => "index_products_taxons_on_taxon_id"
|
349
|
+
|
350
|
+
create_table "spree_properties", :force => true do |t|
|
351
|
+
t.string "name"
|
352
|
+
t.string "presentation", :null => false
|
353
|
+
t.datetime "created_at"
|
354
|
+
t.datetime "updated_at"
|
355
|
+
end
|
356
|
+
|
357
|
+
create_table "spree_properties_prototypes", :id => false, :force => true do |t|
|
358
|
+
t.integer "prototype_id"
|
359
|
+
t.integer "property_id"
|
360
|
+
end
|
361
|
+
|
362
|
+
create_table "spree_prototypes", :force => true do |t|
|
363
|
+
t.string "name"
|
364
|
+
t.datetime "created_at"
|
365
|
+
t.datetime "updated_at"
|
366
|
+
end
|
367
|
+
|
368
|
+
create_table "spree_return_authorizations", :force => true do |t|
|
369
|
+
t.string "number"
|
370
|
+
t.string "state"
|
371
|
+
t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false
|
372
|
+
t.integer "order_id"
|
373
|
+
t.text "reason"
|
374
|
+
t.datetime "created_at"
|
375
|
+
t.datetime "updated_at"
|
376
|
+
end
|
377
|
+
|
378
|
+
create_table "spree_roles", :force => true do |t|
|
379
|
+
t.string "name"
|
380
|
+
end
|
381
|
+
|
382
|
+
create_table "spree_roles_users", :id => false, :force => true do |t|
|
383
|
+
t.integer "role_id"
|
384
|
+
t.integer "user_id"
|
385
|
+
end
|
386
|
+
|
387
|
+
add_index "spree_roles_users", ["role_id"], :name => "index_roles_users_on_role_id"
|
388
|
+
add_index "spree_roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
|
389
|
+
|
390
|
+
create_table "spree_shipments", :force => true do |t|
|
391
|
+
t.string "tracking"
|
392
|
+
t.string "number"
|
393
|
+
t.decimal "cost", :precision => 8, :scale => 2
|
394
|
+
t.datetime "shipped_at"
|
395
|
+
t.integer "order_id"
|
396
|
+
t.integer "shipping_method_id"
|
397
|
+
t.integer "address_id"
|
398
|
+
t.datetime "created_at"
|
399
|
+
t.datetime "updated_at"
|
400
|
+
t.string "state"
|
401
|
+
end
|
402
|
+
|
403
|
+
add_index "spree_shipments", ["number"], :name => "index_shipments_on_number"
|
404
|
+
|
405
|
+
create_table "spree_shipping_categories", :force => true do |t|
|
406
|
+
t.string "name"
|
407
|
+
t.datetime "created_at"
|
408
|
+
t.datetime "updated_at"
|
409
|
+
end
|
410
|
+
|
411
|
+
create_table "spree_shipping_methods", :force => true do |t|
|
412
|
+
t.string "name"
|
413
|
+
t.integer "zone_id"
|
414
|
+
t.datetime "created_at"
|
415
|
+
t.datetime "updated_at"
|
416
|
+
t.string "display_on"
|
417
|
+
t.integer "shipping_category_id"
|
418
|
+
t.boolean "match_none"
|
419
|
+
t.boolean "match_all"
|
420
|
+
t.boolean "match_one"
|
421
|
+
end
|
422
|
+
|
423
|
+
create_table "spree_state_events", :force => true do |t|
|
424
|
+
t.string "name"
|
425
|
+
t.string "previous_state"
|
426
|
+
t.integer "stateful_id"
|
427
|
+
t.integer "user_id"
|
428
|
+
t.datetime "created_at"
|
429
|
+
t.datetime "updated_at"
|
430
|
+
t.string "stateful_type"
|
431
|
+
t.string "next_state"
|
432
|
+
end
|
433
|
+
|
434
|
+
create_table "spree_states", :force => true do |t|
|
435
|
+
t.string "name"
|
436
|
+
t.string "abbr"
|
437
|
+
t.integer "country_id"
|
438
|
+
end
|
439
|
+
|
440
|
+
create_table "spree_tax_categories", :force => true do |t|
|
441
|
+
t.string "name"
|
442
|
+
t.string "description"
|
443
|
+
t.datetime "created_at"
|
444
|
+
t.datetime "updated_at"
|
445
|
+
t.boolean "is_default", :default => false
|
446
|
+
t.datetime "deleted_at"
|
447
|
+
end
|
448
|
+
|
449
|
+
create_table "spree_tax_rates", :force => true do |t|
|
450
|
+
t.decimal "amount"
|
451
|
+
t.integer "zone_id"
|
452
|
+
t.integer "tax_category_id"
|
453
|
+
t.datetime "created_at"
|
454
|
+
t.datetime "updated_at"
|
455
|
+
t.boolean "included_in_price", :default => false
|
456
|
+
end
|
457
|
+
|
458
|
+
create_table "spree_taxonomies", :force => true do |t|
|
459
|
+
t.string "name", :null => false
|
460
|
+
t.datetime "created_at"
|
461
|
+
t.datetime "updated_at"
|
462
|
+
end
|
463
|
+
|
464
|
+
create_table "spree_taxons", :force => true do |t|
|
465
|
+
t.integer "parent_id"
|
466
|
+
t.integer "position", :default => 0
|
467
|
+
t.string "name", :null => false
|
468
|
+
t.string "permalink"
|
469
|
+
t.integer "taxonomy_id"
|
470
|
+
t.datetime "created_at"
|
471
|
+
t.datetime "updated_at"
|
472
|
+
t.integer "lft"
|
473
|
+
t.integer "rgt"
|
474
|
+
t.string "icon_file_name"
|
475
|
+
t.string "icon_content_type"
|
476
|
+
t.integer "icon_file_size"
|
477
|
+
t.datetime "icon_updated_at"
|
478
|
+
t.text "description"
|
479
|
+
end
|
480
|
+
|
481
|
+
add_index "spree_taxons", ["parent_id"], :name => "index_taxons_on_parent_id"
|
482
|
+
add_index "spree_taxons", ["permalink"], :name => "index_taxons_on_permalink"
|
483
|
+
add_index "spree_taxons", ["taxonomy_id"], :name => "index_taxons_on_taxonomy_id"
|
484
|
+
|
485
|
+
create_table "spree_trackers", :force => true do |t|
|
486
|
+
t.string "environment"
|
487
|
+
t.string "analytics_id"
|
488
|
+
t.boolean "active", :default => true
|
489
|
+
t.datetime "created_at"
|
490
|
+
t.datetime "updated_at"
|
491
|
+
end
|
492
|
+
|
493
|
+
create_table "spree_users", :force => true do |t|
|
494
|
+
t.string "crypted_password", :limit => 128
|
495
|
+
t.string "salt", :limit => 128
|
496
|
+
t.string "email"
|
497
|
+
t.string "remember_token"
|
498
|
+
t.string "remember_token_expires_at"
|
499
|
+
t.string "persistence_token"
|
500
|
+
t.string "single_access_token"
|
501
|
+
t.string "perishable_token"
|
502
|
+
t.integer "login_count", :default => 0, :null => false
|
503
|
+
t.integer "failed_login_count", :default => 0, :null => false
|
504
|
+
t.datetime "last_request_at"
|
505
|
+
t.datetime "current_login_at"
|
506
|
+
t.datetime "last_login_at"
|
507
|
+
t.string "current_login_ip"
|
508
|
+
t.string "last_login_ip"
|
509
|
+
t.string "login"
|
510
|
+
t.integer "ship_address_id"
|
511
|
+
t.integer "bill_address_id"
|
512
|
+
t.datetime "created_at"
|
513
|
+
t.datetime "updated_at"
|
514
|
+
t.string "openid_identifier"
|
515
|
+
end
|
516
|
+
|
517
|
+
add_index "spree_users", ["openid_identifier"], :name => "index_users_on_openid_identifier"
|
518
|
+
add_index "spree_users", ["persistence_token"], :name => "index_users_on_persistence_token"
|
519
|
+
|
520
|
+
create_table "spree_variants", :force => true do |t|
|
521
|
+
t.string "sku", :default => "", :null => false
|
522
|
+
t.decimal "price", :precision => 8, :scale => 2, :null => false
|
523
|
+
t.decimal "weight", :precision => 8, :scale => 2
|
524
|
+
t.decimal "height", :precision => 8, :scale => 2
|
525
|
+
t.decimal "width", :precision => 8, :scale => 2
|
526
|
+
t.decimal "depth", :precision => 8, :scale => 2
|
527
|
+
t.datetime "deleted_at"
|
528
|
+
t.boolean "is_master", :default => false
|
529
|
+
t.integer "product_id"
|
530
|
+
t.integer "count_on_hand", :default => 0, :null => false
|
531
|
+
t.decimal "cost_price", :precision => 8, :scale => 2
|
532
|
+
t.integer "position"
|
533
|
+
end
|
534
|
+
|
535
|
+
add_index "spree_variants", ["product_id"], :name => "index_variants_on_product_id"
|
536
|
+
|
537
|
+
create_table "spree_zone_members", :force => true do |t|
|
538
|
+
t.integer "zoneable_id"
|
539
|
+
t.string "zoneable_type"
|
540
|
+
t.integer "zone_id"
|
541
|
+
t.datetime "created_at"
|
542
|
+
t.datetime "updated_at"
|
543
|
+
end
|
544
|
+
|
545
|
+
create_table "spree_zones", :force => true do |t|
|
546
|
+
t.string "name"
|
547
|
+
t.string "description"
|
548
|
+
t.datetime "created_at"
|
549
|
+
t.datetime "updated_at"
|
550
|
+
t.boolean "default_tax", :default => false
|
551
|
+
end
|
552
|
+
|
553
|
+
end
|