solidus_bank_transfer 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +26 -0
- data/README.md +63 -0
- data/Rakefile +32 -0
- data/app/assets/javascripts/spree/backend/solidus_bank_transfer.js +2 -0
- data/app/assets/javascripts/spree/frontend/solidus_bank_transfer.js +2 -0
- data/app/assets/stylesheets/spree/backend/solidus_bank_transfer.css +4 -0
- data/app/assets/stylesheets/spree/frontend/solidus_bank_transfer.css +4 -0
- data/app/models/spree/payment_method/bank_transfer.rb +46 -0
- data/app/views/spree/checkout/payment/_banktransfer.html.erb +16 -0
- data/app/views/spree/order_mailer/_bank_transfer_details.html.erb +23 -0
- data/app/views/spree/orders/_bank_transfer_details.html.erb +22 -0
- data/config/locales/en.yml +14 -0
- data/config/locales/it.yml +14 -0
- data/config/routes.rb +5 -0
- data/lib/generators/solidus_bank_transfer/install/install_generator.rb +32 -0
- data/lib/solidus_bank_transfer.rb +4 -0
- data/lib/solidus_bank_transfer/engine.rb +26 -0
- data/lib/solidus_bank_transfer/factories.rb +17 -0
- data/lib/solidus_bank_transfer/version.rb +5 -0
- data/spec/dummy/README.md +24 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +33 -0
- data/spec/dummy/bin/update +28 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +54 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/credentials.yml.enc +1 -0
- data/spec/dummy/config/database.yml +21 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +61 -0
- data/spec/dummy/config/environments/production.rb +94 -0
- data/spec/dummy/config/environments/test.rb +33 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +12 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/spree.rb +52 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/master.key +1 -0
- data/spec/dummy/config/routes.rb +9 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/db/migrate/20190822070920_create_active_storage_tables.active_storage.rb +27 -0
- data/spec/dummy/db/migrate/20190822070921_solidus_one_four.spree.rb +1103 -0
- data/spec/dummy/db/migrate/20190822070922_create_spree_wallet_payment_sources.spree.rb +28 -0
- data/spec/dummy/db/migrate/20190822070923_migrate_credit_cards_to_wallet_payment_sources.spree.rb +30 -0
- data/spec/dummy/db/migrate/20190822070924_remove_is_default_from_prices.spree.rb +8 -0
- data/spec/dummy/db/migrate/20190822070925_remove_currency_from_line_items.spree.rb +8 -0
- data/spec/dummy/db/migrate/20190822070926_add_available_to_columns_and_remove_display_on_from_payment_methods.spree.rb +31 -0
- data/spec/dummy/db/migrate/20190822070927_create_spree_promotion_code_batch.spree.rb +39 -0
- data/spec/dummy/db/migrate/20190822070928_add_available_to_users_and_remove_display_on_from_shipping_methods.spree.rb +23 -0
- data/spec/dummy/db/migrate/20190822070929_add_index_to_spree_payments_number.spree.rb +8 -0
- data/spec/dummy/db/migrate/20190822070930_remove_spree_store_credits_column.spree.rb +8 -0
- data/spec/dummy/db/migrate/20190822070931_add_lft_and_rgt_indexes_to_taxons.spree.rb +9 -0
- data/spec/dummy/db/migrate/20190822070932_remove_order_id_from_inventory_units.spree.rb +31 -0
- data/spec/dummy/db/migrate/20190822070933_transform_tax_rate_category_relation.spree.rb +51 -0
- data/spec/dummy/db/migrate/20190822070934_add_roles_unique_constraints.spree.rb +9 -0
- data/spec/dummy/db/migrate/20190822070935_add_time_range_to_tax_rate.spree.rb +9 -0
- data/spec/dummy/db/migrate/20190822070936_rename_bogus_gateways.spree.rb +19 -0
- data/spec/dummy/db/migrate/20190822070937_remove_default_tax_from_spree_zones.spree.rb +8 -0
- data/spec/dummy/db/migrate/20190822070938_create_promotion_rule_stores.spree.rb +13 -0
- data/spec/dummy/db/migrate/20190822070939_create_store_shipping_methods.spree.rb +13 -0
- data/spec/dummy/db/migrate/20190822070940_add_available_locales_to_stores.spree.rb +10 -0
- data/spec/dummy/db/migrate/20190822070941_add_amount_remaining_to_store_credit_events.spree.rb +62 -0
- data/spec/dummy/db/migrate/20190822070942_add_join_characters_to_promotion_code_batch.spree.rb +12 -0
- data/spec/dummy/db/migrate/20190822070943_create_spree_store_credit_reasons_table.spree.rb +56 -0
- data/spec/dummy/db/migrate/20190822070944_remove_code_from_spree_promotions.spree.rb +43 -0
- data/spec/dummy/db/migrate/20190822070945_drop_spree_store_credit_update_reasons.spree.rb +20 -0
- data/spec/dummy/db/migrate/20190822070946_add_api_key_to_spree_users.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20190822070947_resize_api_key_field.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20190822070948_rename_api_key_to_spree_api_key.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20190822070949_add_index_to_user_spree_api_key.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20190822070950_create_users.solidus_auth.rb +30 -0
- data/spec/dummy/db/migrate/20190822070951_rename_columns_for_devise.solidus_auth.rb +38 -0
- data/spec/dummy/db/migrate/20190822070952_convert_user_remember_field.solidus_auth.rb +12 -0
- data/spec/dummy/db/migrate/20190822070953_add_reset_password_sent_at_to_spree_users.solidus_auth.rb +9 -0
- data/spec/dummy/db/migrate/20190822070954_make_users_email_index_unique.solidus_auth.rb +10 -0
- data/spec/dummy/db/migrate/20190822070955_add_deleted_at_to_users.solidus_auth.rb +7 -0
- data/spec/dummy/db/migrate/20190822070956_add_confirmable_to_users.solidus_auth.rb +8 -0
- data/spec/dummy/db/schema.rb +1194 -0
- data/spec/dummy/db/seeds.rb +10 -0
- data/spec/dummy/log/test.log +1058 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/development_secret.txt +1 -0
- data/spec/dummy/vendor/assets/javascripts/spree/backend/all.js +11 -0
- data/spec/dummy/vendor/assets/javascripts/spree/frontend/all.js +11 -0
- data/spec/dummy/vendor/assets/stylesheets/spree/backend/all.css +10 -0
- data/spec/dummy/vendor/assets/stylesheets/spree/frontend/all.css +10 -0
- data/spec/models/spree/payment_method/bank_transfer_spec.rb +146 -0
- data/spec/spec_helper.rb +89 -0
- metadata +429 -0
data/spec/dummy/db/migrate/20190822070942_add_join_characters_to_promotion_code_batch.spree.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree (originally 20180328172631)
|
3
|
+
|
4
|
+
class AddJoinCharactersToPromotionCodeBatch < ActiveRecord::Migration[5.1]
|
5
|
+
def change
|
6
|
+
add_column(:spree_promotion_code_batches,
|
7
|
+
:join_characters,
|
8
|
+
:string,
|
9
|
+
null: false,
|
10
|
+
default: '_')
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree (originally 20180710170104)
|
3
|
+
|
4
|
+
class CreateSpreeStoreCreditReasonsTable < ActiveRecord::Migration[5.1]
|
5
|
+
class StoreCreditUpdateReason < ActiveRecord::Base
|
6
|
+
self.table_name = "spree_store_credit_update_reasons"
|
7
|
+
end
|
8
|
+
|
9
|
+
class StoreCreditReason < ActiveRecord::Base
|
10
|
+
self.table_name = "spree_store_credit_reasons"
|
11
|
+
end
|
12
|
+
|
13
|
+
def up
|
14
|
+
create_table :spree_store_credit_reasons do |t|
|
15
|
+
t.string :name
|
16
|
+
t.boolean :active, default: true
|
17
|
+
|
18
|
+
t.timestamps
|
19
|
+
end
|
20
|
+
|
21
|
+
StoreCreditUpdateReason.all.each do |update_reason|
|
22
|
+
StoreCreditReason.create!(name: update_reason.name)
|
23
|
+
end
|
24
|
+
|
25
|
+
add_column :spree_store_credit_events, :store_credit_reason_id, :integer
|
26
|
+
execute "update spree_store_credit_events set store_credit_reason_id = update_reason_id"
|
27
|
+
|
28
|
+
# TODO: table spree_store_credit_update_reasons and column
|
29
|
+
# column spree_store_credit_update_reasons.update_reason_id
|
30
|
+
# must be dropped in a future Solidus release
|
31
|
+
end
|
32
|
+
|
33
|
+
def down
|
34
|
+
# This table and column may not exist anymore as another irreversible
|
35
|
+
# migration may have removed it later. They must be added back or the
|
36
|
+
# `up` method would fail
|
37
|
+
unless table_exists? :spree_store_credit_update_reasons
|
38
|
+
create_table :spree_store_credit_update_reasons do |t|
|
39
|
+
t.string :name
|
40
|
+
|
41
|
+
t.timestamps
|
42
|
+
end
|
43
|
+
|
44
|
+
unless column_exists? :spree_store_credit_events, :update_reason_id
|
45
|
+
add_column :spree_store_credit_events, :update_reason_id, :integer
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
StoreCreditReason.all.each do |store_credit_reason|
|
50
|
+
StoreCreditUpdateReason.create!(name: store_credit_reason.name)
|
51
|
+
end
|
52
|
+
|
53
|
+
drop_table :spree_store_credit_reasons
|
54
|
+
remove_column :spree_store_credit_events, :store_credit_reason_id
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree (originally 20190106184413)
|
3
|
+
|
4
|
+
require 'solidus/migrations/promotions_with_code_handlers'
|
5
|
+
|
6
|
+
class RemoveCodeFromSpreePromotions < ActiveRecord::Migration[5.1]
|
7
|
+
class Promotion < ActiveRecord::Base
|
8
|
+
self.table_name = "spree_promotions"
|
9
|
+
self.ignored_columns = %w(type)
|
10
|
+
end
|
11
|
+
|
12
|
+
def up
|
13
|
+
promotions_with_code = Promotion.where.not(code: [nil, ''])
|
14
|
+
|
15
|
+
if promotions_with_code.any?
|
16
|
+
# You have some promotions with "code" field present! This is not good
|
17
|
+
# since we are going to remove that column.
|
18
|
+
#
|
19
|
+
self.class.promotions_with_code_handler.new(self, promotions_with_code).call
|
20
|
+
end
|
21
|
+
|
22
|
+
remove_index :spree_promotions, name: :index_spree_promotions_on_code
|
23
|
+
remove_column :spree_promotions, :code
|
24
|
+
end
|
25
|
+
|
26
|
+
def down
|
27
|
+
add_column :spree_promotions, :code, :string
|
28
|
+
add_index :spree_promotions, :code, name: :index_spree_promotions_on_code
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.promotions_with_code_handler
|
32
|
+
# We propose different approaches, just pick the one that you prefer or
|
33
|
+
# write your custom one.
|
34
|
+
#
|
35
|
+
# The fist one (raising an exception) is the default but you can
|
36
|
+
# comment/uncomment the one then better fits you needs or use a
|
37
|
+
# custom class or callable object.
|
38
|
+
#
|
39
|
+
Solidus::Migrations::PromotionWithCodeHandlers::RaiseException
|
40
|
+
# Solidus::Migrations::PromotionWithCodeHandlers::MoveToSpreePromotionCode
|
41
|
+
# Solidus::Migrations::PromotionWithCodeHandlers::DoNothing
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree (originally 20190220093635)
|
3
|
+
|
4
|
+
class DropSpreeStoreCreditUpdateReasons < ActiveRecord::Migration[5.1]
|
5
|
+
# This migration should run in a subsequent deploy after 20180710170104
|
6
|
+
# has been already deployed. See also migration 20180710170104.
|
7
|
+
|
8
|
+
# We can't add back the table in a `down` method here: a previous version
|
9
|
+
# of migration 20180710170104 would fail with `table already exists` , as
|
10
|
+
# it handles itself the add/remove of this table and column.
|
11
|
+
def up
|
12
|
+
if table_exists? :spree_store_credit_update_reasons
|
13
|
+
drop_table :spree_store_credit_update_reasons
|
14
|
+
end
|
15
|
+
|
16
|
+
if column_exists? :spree_store_credit_events, :update_reason_id
|
17
|
+
remove_column :spree_store_credit_events, :update_reason_id
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree_api (originally 20100107141738)
|
3
|
+
|
4
|
+
class AddApiKeyToSpreeUsers < ActiveRecord::Migration[4.2]
|
5
|
+
def change
|
6
|
+
unless defined?(User)
|
7
|
+
add_column :spree_users, :api_key, :string, limit: 40
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree_api (originally 20120411123334)
|
3
|
+
|
4
|
+
class ResizeApiKeyField < ActiveRecord::Migration[4.2]
|
5
|
+
def up
|
6
|
+
unless defined?(User)
|
7
|
+
change_column :spree_users, :api_key, :string, limit: 48
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree_api (originally 20120530054546)
|
3
|
+
|
4
|
+
class RenameApiKeyToSpreeApiKey < ActiveRecord::Migration[4.2]
|
5
|
+
def change
|
6
|
+
unless defined?(User)
|
7
|
+
rename_column :spree_users, :api_key, :spree_api_key
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from spree_api (originally 20131017162334)
|
3
|
+
|
4
|
+
class AddIndexToUserSpreeApiKey < ActiveRecord::Migration[4.2]
|
5
|
+
def change
|
6
|
+
unless defined?(User)
|
7
|
+
add_index :spree_users, :spree_api_key
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# This migration comes from solidus_auth (originally 20101026184949)
|
2
|
+
class CreateUsers < SolidusSupport::Migration[4.2]
|
3
|
+
def up
|
4
|
+
unless table_exists?("spree_users")
|
5
|
+
create_table "spree_users", :force => true do |t|
|
6
|
+
t.string "crypted_password", :limit => 128
|
7
|
+
t.string "salt", :limit => 128
|
8
|
+
t.string "email"
|
9
|
+
t.string "remember_token"
|
10
|
+
t.string "remember_token_expires_at"
|
11
|
+
t.string "persistence_token"
|
12
|
+
t.string "single_access_token"
|
13
|
+
t.string "perishable_token"
|
14
|
+
t.integer "login_count", :default => 0, :null => false
|
15
|
+
t.integer "failed_login_count", :default => 0, :null => false
|
16
|
+
t.datetime "last_request_at"
|
17
|
+
t.datetime "current_login_at"
|
18
|
+
t.datetime "last_login_at"
|
19
|
+
t.string "current_login_ip"
|
20
|
+
t.string "last_login_ip"
|
21
|
+
t.string "login"
|
22
|
+
t.integer "ship_address_id"
|
23
|
+
t.integer "bill_address_id"
|
24
|
+
t.datetime "created_at", :null => false
|
25
|
+
t.datetime "updated_at", :null => false
|
26
|
+
t.string "openid_identifier"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This migration comes from solidus_auth (originally 20101026184950)
|
2
|
+
class RenameColumnsForDevise < SolidusSupport::Migration[4.2]
|
3
|
+
def up
|
4
|
+
return if column_exists?(:spree_users, :password_salt)
|
5
|
+
rename_column :spree_users, :crypted_password, :encrypted_password
|
6
|
+
rename_column :spree_users, :salt, :password_salt
|
7
|
+
rename_column :spree_users, :remember_token_expires_at, :remember_created_at
|
8
|
+
rename_column :spree_users, :login_count, :sign_in_count
|
9
|
+
rename_column :spree_users, :failed_login_count, :failed_attempts
|
10
|
+
rename_column :spree_users, :single_access_token, :reset_password_token
|
11
|
+
rename_column :spree_users, :current_login_at, :current_sign_in_at
|
12
|
+
rename_column :spree_users, :last_login_at, :last_sign_in_at
|
13
|
+
rename_column :spree_users, :current_login_ip, :current_sign_in_ip
|
14
|
+
rename_column :spree_users, :last_login_ip, :last_sign_in_ip
|
15
|
+
add_column :spree_users, :authentication_token, :string
|
16
|
+
add_column :spree_users, :unlock_token, :string
|
17
|
+
add_column :spree_users, :locked_at, :datetime
|
18
|
+
remove_column :spree_users, :openid_identifier
|
19
|
+
end
|
20
|
+
|
21
|
+
def down
|
22
|
+
remove_column :spree_users, :authentication_token
|
23
|
+
remove_column :spree_users, :locked_at
|
24
|
+
remove_column :spree_users, :unlock_token
|
25
|
+
rename_column :spree_users, :last_sign_in_ip, :last_login_ip
|
26
|
+
rename_column :spree_users, :current_sign_in_ip, :current_login_ip
|
27
|
+
rename_column :spree_users, :last_sign_in_at, :last_login_at
|
28
|
+
rename_column :spree_users, :current_sign_in_at, :current_login_at
|
29
|
+
rename_column :spree_users, :reset_password_token, :single_access_token
|
30
|
+
rename_column :spree_users, :failed_attempts, :failed_login_count
|
31
|
+
rename_column :spree_users, :sign_in_count, :login_count
|
32
|
+
rename_column :spree_users, :remember_created_at, :remember_token_expires_at
|
33
|
+
rename_column :spree_users, :password_salt, :salt
|
34
|
+
rename_column :spree_users, :encrypted_password, :crypted_password
|
35
|
+
add_column :spree_users, :unlock_token, :string
|
36
|
+
add_column :spree_users, :openid_identifier, :string
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from solidus_auth (originally 20101214150824)
|
2
|
+
class ConvertUserRememberField < SolidusSupport::Migration[4.2]
|
3
|
+
def up
|
4
|
+
remove_column :spree_users, :remember_created_at
|
5
|
+
add_column :spree_users, :remember_created_at, :datetime
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
remove_column :spree_users, :remember_created_at
|
10
|
+
add_column :spree_users, :remember_created_at, :string
|
11
|
+
end
|
12
|
+
end
|
data/spec/dummy/db/migrate/20190822070953_add_reset_password_sent_at_to_spree_users.solidus_auth.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# This migration comes from solidus_auth (originally 20120203010234)
|
2
|
+
class AddResetPasswordSentAtToSpreeUsers < SolidusSupport::Migration[4.2]
|
3
|
+
def change
|
4
|
+
Spree::User.reset_column_information
|
5
|
+
unless Spree::User.column_names.include?("reset_password_sent_at")
|
6
|
+
add_column :spree_users, :reset_password_sent_at, :datetime
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This migration comes from solidus_auth (originally 20120605211305)
|
2
|
+
class MakeUsersEmailIndexUnique < SolidusSupport::Migration[4.2]
|
3
|
+
def up
|
4
|
+
add_index "spree_users", ["email"], :name => "email_idx_unique", :unique => true
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
remove_index "spree_users", :name => "email_idx_unique"
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# This migration comes from solidus_auth (originally 20141002154641)
|
2
|
+
class AddConfirmableToUsers < SolidusSupport::Migration[4.2]
|
3
|
+
def change
|
4
|
+
add_column :spree_users, :confirmation_token, :string
|
5
|
+
add_column :spree_users, :confirmed_at, :datetime
|
6
|
+
add_column :spree_users, :confirmation_sent_at, :datetime
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,1194 @@
|
|
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 that you check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(version: 2019_08_22_070956) do
|
14
|
+
|
15
|
+
# These are extensions that must be enabled in order to support this database
|
16
|
+
enable_extension "plpgsql"
|
17
|
+
|
18
|
+
create_table "active_storage_attachments", force: :cascade do |t|
|
19
|
+
t.string "name", null: false
|
20
|
+
t.string "record_type", null: false
|
21
|
+
t.bigint "record_id", null: false
|
22
|
+
t.bigint "blob_id", null: false
|
23
|
+
t.datetime "created_at", null: false
|
24
|
+
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
25
|
+
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
26
|
+
end
|
27
|
+
|
28
|
+
create_table "active_storage_blobs", force: :cascade do |t|
|
29
|
+
t.string "key", null: false
|
30
|
+
t.string "filename", null: false
|
31
|
+
t.string "content_type"
|
32
|
+
t.text "metadata"
|
33
|
+
t.bigint "byte_size", null: false
|
34
|
+
t.string "checksum", null: false
|
35
|
+
t.datetime "created_at", null: false
|
36
|
+
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
37
|
+
end
|
38
|
+
|
39
|
+
create_table "friendly_id_slugs", id: :serial, force: :cascade do |t|
|
40
|
+
t.string "slug", null: false
|
41
|
+
t.integer "sluggable_id", null: false
|
42
|
+
t.string "sluggable_type", limit: 50
|
43
|
+
t.string "scope"
|
44
|
+
t.datetime "created_at", precision: 6
|
45
|
+
t.datetime "updated_at", precision: 6
|
46
|
+
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
|
47
|
+
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
|
48
|
+
t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
|
49
|
+
t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
|
50
|
+
end
|
51
|
+
|
52
|
+
create_table "spree_addresses", id: :serial, force: :cascade do |t|
|
53
|
+
t.string "firstname"
|
54
|
+
t.string "lastname"
|
55
|
+
t.string "address1"
|
56
|
+
t.string "address2"
|
57
|
+
t.string "city"
|
58
|
+
t.string "zipcode"
|
59
|
+
t.string "phone"
|
60
|
+
t.string "state_name"
|
61
|
+
t.string "alternative_phone"
|
62
|
+
t.string "company"
|
63
|
+
t.integer "state_id"
|
64
|
+
t.integer "country_id"
|
65
|
+
t.datetime "created_at", precision: 6
|
66
|
+
t.datetime "updated_at", precision: 6
|
67
|
+
t.index ["country_id"], name: "index_spree_addresses_on_country_id"
|
68
|
+
t.index ["firstname"], name: "index_addresses_on_firstname"
|
69
|
+
t.index ["lastname"], name: "index_addresses_on_lastname"
|
70
|
+
t.index ["state_id"], name: "index_spree_addresses_on_state_id"
|
71
|
+
end
|
72
|
+
|
73
|
+
create_table "spree_adjustment_reasons", id: :serial, force: :cascade do |t|
|
74
|
+
t.string "name"
|
75
|
+
t.string "code"
|
76
|
+
t.boolean "active", default: true
|
77
|
+
t.datetime "created_at", precision: 6
|
78
|
+
t.datetime "updated_at", precision: 6
|
79
|
+
t.index ["active"], name: "index_spree_adjustment_reasons_on_active"
|
80
|
+
t.index ["code"], name: "index_spree_adjustment_reasons_on_code"
|
81
|
+
end
|
82
|
+
|
83
|
+
create_table "spree_adjustments", id: :serial, force: :cascade do |t|
|
84
|
+
t.string "source_type"
|
85
|
+
t.integer "source_id"
|
86
|
+
t.string "adjustable_type"
|
87
|
+
t.integer "adjustable_id", null: false
|
88
|
+
t.decimal "amount", precision: 10, scale: 2
|
89
|
+
t.string "label"
|
90
|
+
t.boolean "eligible", default: true
|
91
|
+
t.datetime "created_at", precision: 6
|
92
|
+
t.datetime "updated_at", precision: 6
|
93
|
+
t.integer "order_id", null: false
|
94
|
+
t.boolean "included", default: false
|
95
|
+
t.integer "promotion_code_id"
|
96
|
+
t.integer "adjustment_reason_id"
|
97
|
+
t.boolean "finalized", default: false, null: false
|
98
|
+
t.index ["adjustable_id", "adjustable_type"], name: "index_spree_adjustments_on_adjustable_id_and_adjustable_type"
|
99
|
+
t.index ["adjustable_id"], name: "index_adjustments_on_order_id"
|
100
|
+
t.index ["eligible"], name: "index_spree_adjustments_on_eligible"
|
101
|
+
t.index ["order_id"], name: "index_spree_adjustments_on_order_id"
|
102
|
+
t.index ["promotion_code_id"], name: "index_spree_adjustments_on_promotion_code_id"
|
103
|
+
t.index ["source_id", "source_type"], name: "index_spree_adjustments_on_source_id_and_source_type"
|
104
|
+
end
|
105
|
+
|
106
|
+
create_table "spree_assets", id: :serial, force: :cascade do |t|
|
107
|
+
t.string "viewable_type"
|
108
|
+
t.integer "viewable_id"
|
109
|
+
t.integer "attachment_width"
|
110
|
+
t.integer "attachment_height"
|
111
|
+
t.integer "attachment_file_size"
|
112
|
+
t.integer "position"
|
113
|
+
t.string "attachment_content_type"
|
114
|
+
t.string "attachment_file_name"
|
115
|
+
t.string "type", limit: 75
|
116
|
+
t.datetime "attachment_updated_at"
|
117
|
+
t.text "alt"
|
118
|
+
t.datetime "created_at", precision: 6
|
119
|
+
t.datetime "updated_at", precision: 6
|
120
|
+
t.index ["viewable_id"], name: "index_assets_on_viewable_id"
|
121
|
+
t.index ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type"
|
122
|
+
end
|
123
|
+
|
124
|
+
create_table "spree_calculators", id: :serial, force: :cascade do |t|
|
125
|
+
t.string "type"
|
126
|
+
t.string "calculable_type"
|
127
|
+
t.integer "calculable_id"
|
128
|
+
t.datetime "created_at", precision: 6
|
129
|
+
t.datetime "updated_at", precision: 6
|
130
|
+
t.text "preferences"
|
131
|
+
t.index ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type"
|
132
|
+
t.index ["id", "type"], name: "index_spree_calculators_on_id_and_type"
|
133
|
+
end
|
134
|
+
|
135
|
+
create_table "spree_cartons", id: :serial, force: :cascade do |t|
|
136
|
+
t.string "number"
|
137
|
+
t.string "external_number"
|
138
|
+
t.integer "stock_location_id"
|
139
|
+
t.integer "address_id"
|
140
|
+
t.integer "shipping_method_id"
|
141
|
+
t.string "tracking"
|
142
|
+
t.datetime "shipped_at"
|
143
|
+
t.datetime "created_at", precision: 6
|
144
|
+
t.datetime "updated_at", precision: 6
|
145
|
+
t.integer "imported_from_shipment_id"
|
146
|
+
t.index ["external_number"], name: "index_spree_cartons_on_external_number"
|
147
|
+
t.index ["imported_from_shipment_id"], name: "index_spree_cartons_on_imported_from_shipment_id", unique: true
|
148
|
+
t.index ["number"], name: "index_spree_cartons_on_number", unique: true
|
149
|
+
t.index ["stock_location_id"], name: "index_spree_cartons_on_stock_location_id"
|
150
|
+
end
|
151
|
+
|
152
|
+
create_table "spree_countries", id: :serial, force: :cascade do |t|
|
153
|
+
t.string "iso_name"
|
154
|
+
t.string "iso"
|
155
|
+
t.string "iso3"
|
156
|
+
t.string "name"
|
157
|
+
t.integer "numcode"
|
158
|
+
t.boolean "states_required", default: false
|
159
|
+
t.datetime "updated_at", precision: 6
|
160
|
+
t.datetime "created_at", precision: 6
|
161
|
+
t.index ["iso"], name: "index_spree_countries_on_iso"
|
162
|
+
end
|
163
|
+
|
164
|
+
create_table "spree_credit_cards", id: :serial, force: :cascade do |t|
|
165
|
+
t.string "month"
|
166
|
+
t.string "year"
|
167
|
+
t.string "cc_type"
|
168
|
+
t.string "last_digits"
|
169
|
+
t.string "gateway_customer_profile_id"
|
170
|
+
t.string "gateway_payment_profile_id"
|
171
|
+
t.datetime "created_at", precision: 6
|
172
|
+
t.datetime "updated_at", precision: 6
|
173
|
+
t.string "name"
|
174
|
+
t.integer "user_id"
|
175
|
+
t.integer "payment_method_id"
|
176
|
+
t.boolean "default", default: false, null: false
|
177
|
+
t.integer "address_id"
|
178
|
+
t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id"
|
179
|
+
t.index ["user_id"], name: "index_spree_credit_cards_on_user_id"
|
180
|
+
end
|
181
|
+
|
182
|
+
create_table "spree_customer_returns", id: :serial, force: :cascade do |t|
|
183
|
+
t.string "number"
|
184
|
+
t.integer "stock_location_id"
|
185
|
+
t.datetime "created_at", precision: 6
|
186
|
+
t.datetime "updated_at", precision: 6
|
187
|
+
end
|
188
|
+
|
189
|
+
create_table "spree_inventory_units", id: :serial, force: :cascade do |t|
|
190
|
+
t.string "state"
|
191
|
+
t.integer "variant_id"
|
192
|
+
t.integer "shipment_id"
|
193
|
+
t.datetime "created_at", precision: 6
|
194
|
+
t.datetime "updated_at", precision: 6
|
195
|
+
t.boolean "pending", default: true
|
196
|
+
t.integer "line_item_id"
|
197
|
+
t.integer "carton_id"
|
198
|
+
t.index ["carton_id"], name: "index_spree_inventory_units_on_carton_id"
|
199
|
+
t.index ["line_item_id"], name: "index_spree_inventory_units_on_line_item_id"
|
200
|
+
t.index ["shipment_id"], name: "index_inventory_units_on_shipment_id"
|
201
|
+
t.index ["variant_id"], name: "index_inventory_units_on_variant_id"
|
202
|
+
end
|
203
|
+
|
204
|
+
create_table "spree_line_item_actions", id: :serial, force: :cascade do |t|
|
205
|
+
t.integer "line_item_id", null: false
|
206
|
+
t.integer "action_id", null: false
|
207
|
+
t.integer "quantity", default: 0
|
208
|
+
t.datetime "created_at", precision: 6
|
209
|
+
t.datetime "updated_at", precision: 6
|
210
|
+
t.index ["action_id"], name: "index_spree_line_item_actions_on_action_id"
|
211
|
+
t.index ["line_item_id"], name: "index_spree_line_item_actions_on_line_item_id"
|
212
|
+
end
|
213
|
+
|
214
|
+
create_table "spree_line_items", id: :serial, force: :cascade do |t|
|
215
|
+
t.integer "variant_id"
|
216
|
+
t.integer "order_id"
|
217
|
+
t.integer "quantity", null: false
|
218
|
+
t.decimal "price", precision: 10, scale: 2, null: false
|
219
|
+
t.datetime "created_at", precision: 6
|
220
|
+
t.datetime "updated_at", precision: 6
|
221
|
+
t.decimal "cost_price", precision: 10, scale: 2
|
222
|
+
t.integer "tax_category_id"
|
223
|
+
t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0"
|
224
|
+
t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"
|
225
|
+
t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"
|
226
|
+
t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false
|
227
|
+
t.index ["order_id"], name: "index_spree_line_items_on_order_id"
|
228
|
+
t.index ["variant_id"], name: "index_spree_line_items_on_variant_id"
|
229
|
+
end
|
230
|
+
|
231
|
+
create_table "spree_log_entries", id: :serial, force: :cascade do |t|
|
232
|
+
t.string "source_type"
|
233
|
+
t.integer "source_id"
|
234
|
+
t.text "details"
|
235
|
+
t.datetime "created_at", precision: 6
|
236
|
+
t.datetime "updated_at", precision: 6
|
237
|
+
t.index ["source_id", "source_type"], name: "index_spree_log_entries_on_source_id_and_source_type"
|
238
|
+
end
|
239
|
+
|
240
|
+
create_table "spree_option_type_prototypes", id: :serial, force: :cascade do |t|
|
241
|
+
t.integer "prototype_id"
|
242
|
+
t.integer "option_type_id"
|
243
|
+
t.datetime "created_at", precision: 6
|
244
|
+
t.datetime "updated_at", precision: 6
|
245
|
+
end
|
246
|
+
|
247
|
+
create_table "spree_option_types", id: :serial, force: :cascade do |t|
|
248
|
+
t.string "name", limit: 100
|
249
|
+
t.string "presentation", limit: 100
|
250
|
+
t.integer "position", default: 0, null: false
|
251
|
+
t.datetime "created_at", precision: 6
|
252
|
+
t.datetime "updated_at", precision: 6
|
253
|
+
t.index ["position"], name: "index_spree_option_types_on_position"
|
254
|
+
end
|
255
|
+
|
256
|
+
create_table "spree_option_values", id: :serial, force: :cascade do |t|
|
257
|
+
t.integer "position"
|
258
|
+
t.string "name"
|
259
|
+
t.string "presentation"
|
260
|
+
t.integer "option_type_id"
|
261
|
+
t.datetime "created_at", precision: 6
|
262
|
+
t.datetime "updated_at", precision: 6
|
263
|
+
t.index ["option_type_id"], name: "index_spree_option_values_on_option_type_id"
|
264
|
+
t.index ["position"], name: "index_spree_option_values_on_position"
|
265
|
+
end
|
266
|
+
|
267
|
+
create_table "spree_option_values_variants", id: :serial, force: :cascade do |t|
|
268
|
+
t.integer "variant_id"
|
269
|
+
t.integer "option_value_id"
|
270
|
+
t.datetime "created_at", precision: 6
|
271
|
+
t.datetime "updated_at", precision: 6
|
272
|
+
t.index ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id"
|
273
|
+
t.index ["variant_id"], name: "index_spree_option_values_variants_on_variant_id"
|
274
|
+
end
|
275
|
+
|
276
|
+
create_table "spree_order_mutexes", id: :serial, force: :cascade do |t|
|
277
|
+
t.integer "order_id", null: false
|
278
|
+
t.datetime "created_at", precision: 6
|
279
|
+
t.index ["order_id"], name: "index_spree_order_mutexes_on_order_id", unique: true
|
280
|
+
end
|
281
|
+
|
282
|
+
create_table "spree_orders", id: :serial, force: :cascade do |t|
|
283
|
+
t.string "number", limit: 32
|
284
|
+
t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false
|
285
|
+
t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false
|
286
|
+
t.string "state"
|
287
|
+
t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false
|
288
|
+
t.integer "user_id"
|
289
|
+
t.datetime "completed_at"
|
290
|
+
t.integer "bill_address_id"
|
291
|
+
t.integer "ship_address_id"
|
292
|
+
t.decimal "payment_total", precision: 10, scale: 2, default: "0.0"
|
293
|
+
t.string "shipment_state"
|
294
|
+
t.string "payment_state"
|
295
|
+
t.string "email"
|
296
|
+
t.text "special_instructions"
|
297
|
+
t.datetime "created_at", precision: 6
|
298
|
+
t.datetime "updated_at", precision: 6
|
299
|
+
t.string "currency"
|
300
|
+
t.string "last_ip_address"
|
301
|
+
t.integer "created_by_id"
|
302
|
+
t.decimal "shipment_total", precision: 10, scale: 2, default: "0.0", null: false
|
303
|
+
t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"
|
304
|
+
t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"
|
305
|
+
t.string "channel", default: "spree"
|
306
|
+
t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false
|
307
|
+
t.integer "item_count", default: 0
|
308
|
+
t.integer "approver_id"
|
309
|
+
t.datetime "approved_at"
|
310
|
+
t.boolean "confirmation_delivered", default: false
|
311
|
+
t.string "guest_token"
|
312
|
+
t.datetime "canceled_at"
|
313
|
+
t.integer "canceler_id"
|
314
|
+
t.integer "store_id"
|
315
|
+
t.string "approver_name"
|
316
|
+
t.boolean "frontend_viewable", default: true, null: false
|
317
|
+
t.index ["approver_id"], name: "index_spree_orders_on_approver_id"
|
318
|
+
t.index ["bill_address_id"], name: "index_spree_orders_on_bill_address_id"
|
319
|
+
t.index ["completed_at"], name: "index_spree_orders_on_completed_at"
|
320
|
+
t.index ["created_by_id"], name: "index_spree_orders_on_created_by_id"
|
321
|
+
t.index ["guest_token"], name: "index_spree_orders_on_guest_token"
|
322
|
+
t.index ["number"], name: "index_spree_orders_on_number"
|
323
|
+
t.index ["ship_address_id"], name: "index_spree_orders_on_ship_address_id"
|
324
|
+
t.index ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id"
|
325
|
+
t.index ["user_id"], name: "index_spree_orders_on_user_id"
|
326
|
+
end
|
327
|
+
|
328
|
+
create_table "spree_orders_promotions", id: :serial, force: :cascade do |t|
|
329
|
+
t.integer "order_id"
|
330
|
+
t.integer "promotion_id"
|
331
|
+
t.integer "promotion_code_id"
|
332
|
+
t.datetime "created_at", precision: 6
|
333
|
+
t.datetime "updated_at", precision: 6
|
334
|
+
t.index ["order_id", "promotion_id"], name: "index_spree_orders_promotions_on_order_id_and_promotion_id"
|
335
|
+
t.index ["promotion_code_id"], name: "index_spree_orders_promotions_on_promotion_code_id"
|
336
|
+
end
|
337
|
+
|
338
|
+
create_table "spree_payment_capture_events", id: :serial, force: :cascade do |t|
|
339
|
+
t.decimal "amount", precision: 10, scale: 2, default: "0.0"
|
340
|
+
t.integer "payment_id"
|
341
|
+
t.datetime "created_at", precision: 6
|
342
|
+
t.datetime "updated_at", precision: 6
|
343
|
+
t.index ["payment_id"], name: "index_spree_payment_capture_events_on_payment_id"
|
344
|
+
end
|
345
|
+
|
346
|
+
create_table "spree_payment_methods", id: :serial, force: :cascade do |t|
|
347
|
+
t.string "type"
|
348
|
+
t.string "name"
|
349
|
+
t.text "description"
|
350
|
+
t.boolean "active", default: true
|
351
|
+
t.datetime "deleted_at"
|
352
|
+
t.datetime "created_at", precision: 6
|
353
|
+
t.datetime "updated_at", precision: 6
|
354
|
+
t.boolean "auto_capture"
|
355
|
+
t.text "preferences"
|
356
|
+
t.string "preference_source"
|
357
|
+
t.integer "position", default: 0
|
358
|
+
t.boolean "available_to_users", default: true
|
359
|
+
t.boolean "available_to_admin", default: true
|
360
|
+
t.index ["id", "type"], name: "index_spree_payment_methods_on_id_and_type"
|
361
|
+
end
|
362
|
+
|
363
|
+
create_table "spree_payments", id: :serial, force: :cascade do |t|
|
364
|
+
t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
|
365
|
+
t.integer "order_id"
|
366
|
+
t.string "source_type"
|
367
|
+
t.integer "source_id"
|
368
|
+
t.integer "payment_method_id"
|
369
|
+
t.string "state"
|
370
|
+
t.string "response_code"
|
371
|
+
t.string "avs_response"
|
372
|
+
t.datetime "created_at", precision: 6
|
373
|
+
t.datetime "updated_at", precision: 6
|
374
|
+
t.string "number"
|
375
|
+
t.string "cvv_response_code"
|
376
|
+
t.string "cvv_response_message"
|
377
|
+
t.index ["number"], name: "index_spree_payments_on_number", unique: true
|
378
|
+
t.index ["order_id"], name: "index_spree_payments_on_order_id"
|
379
|
+
t.index ["payment_method_id"], name: "index_spree_payments_on_payment_method_id"
|
380
|
+
t.index ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type"
|
381
|
+
end
|
382
|
+
|
383
|
+
create_table "spree_preferences", id: :serial, force: :cascade do |t|
|
384
|
+
t.text "value"
|
385
|
+
t.string "key"
|
386
|
+
t.datetime "created_at", precision: 6
|
387
|
+
t.datetime "updated_at", precision: 6
|
388
|
+
t.index ["key"], name: "index_spree_preferences_on_key", unique: true
|
389
|
+
end
|
390
|
+
|
391
|
+
create_table "spree_prices", id: :serial, force: :cascade do |t|
|
392
|
+
t.integer "variant_id", null: false
|
393
|
+
t.decimal "amount", precision: 10, scale: 2
|
394
|
+
t.string "currency"
|
395
|
+
t.datetime "deleted_at"
|
396
|
+
t.datetime "created_at", precision: 6
|
397
|
+
t.datetime "updated_at", precision: 6
|
398
|
+
t.string "country_iso", limit: 2
|
399
|
+
t.index ["country_iso"], name: "index_spree_prices_on_country_iso"
|
400
|
+
t.index ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency"
|
401
|
+
end
|
402
|
+
|
403
|
+
create_table "spree_product_option_types", id: :serial, force: :cascade do |t|
|
404
|
+
t.integer "position"
|
405
|
+
t.integer "product_id"
|
406
|
+
t.integer "option_type_id"
|
407
|
+
t.datetime "created_at", precision: 6
|
408
|
+
t.datetime "updated_at", precision: 6
|
409
|
+
t.index ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id"
|
410
|
+
t.index ["position"], name: "index_spree_product_option_types_on_position"
|
411
|
+
t.index ["product_id"], name: "index_spree_product_option_types_on_product_id"
|
412
|
+
end
|
413
|
+
|
414
|
+
create_table "spree_product_promotion_rules", id: :serial, force: :cascade do |t|
|
415
|
+
t.integer "product_id"
|
416
|
+
t.integer "promotion_rule_id"
|
417
|
+
t.datetime "created_at", precision: 6
|
418
|
+
t.datetime "updated_at", precision: 6
|
419
|
+
t.index ["product_id"], name: "index_products_promotion_rules_on_product_id"
|
420
|
+
t.index ["promotion_rule_id"], name: "index_products_promotion_rules_on_promotion_rule_id"
|
421
|
+
end
|
422
|
+
|
423
|
+
create_table "spree_product_properties", id: :serial, force: :cascade do |t|
|
424
|
+
t.string "value"
|
425
|
+
t.integer "product_id"
|
426
|
+
t.integer "property_id"
|
427
|
+
t.datetime "created_at", precision: 6
|
428
|
+
t.datetime "updated_at", precision: 6
|
429
|
+
t.integer "position", default: 0
|
430
|
+
t.index ["position"], name: "index_spree_product_properties_on_position"
|
431
|
+
t.index ["product_id"], name: "index_product_properties_on_product_id"
|
432
|
+
t.index ["property_id"], name: "index_spree_product_properties_on_property_id"
|
433
|
+
end
|
434
|
+
|
435
|
+
create_table "spree_products", id: :serial, force: :cascade do |t|
|
436
|
+
t.string "name", default: "", null: false
|
437
|
+
t.text "description"
|
438
|
+
t.datetime "available_on"
|
439
|
+
t.datetime "deleted_at"
|
440
|
+
t.string "slug"
|
441
|
+
t.text "meta_description"
|
442
|
+
t.string "meta_keywords"
|
443
|
+
t.integer "tax_category_id"
|
444
|
+
t.integer "shipping_category_id"
|
445
|
+
t.datetime "created_at", precision: 6
|
446
|
+
t.datetime "updated_at", precision: 6
|
447
|
+
t.boolean "promotionable", default: true
|
448
|
+
t.string "meta_title"
|
449
|
+
t.index ["available_on"], name: "index_spree_products_on_available_on"
|
450
|
+
t.index ["deleted_at"], name: "index_spree_products_on_deleted_at"
|
451
|
+
t.index ["name"], name: "index_spree_products_on_name"
|
452
|
+
t.index ["slug"], name: "index_spree_products_on_slug", unique: true
|
453
|
+
end
|
454
|
+
|
455
|
+
create_table "spree_products_taxons", id: :serial, force: :cascade do |t|
|
456
|
+
t.integer "product_id"
|
457
|
+
t.integer "taxon_id"
|
458
|
+
t.integer "position"
|
459
|
+
t.datetime "created_at", precision: 6
|
460
|
+
t.datetime "updated_at", precision: 6
|
461
|
+
t.index ["position"], name: "index_spree_products_taxons_on_position"
|
462
|
+
t.index ["product_id"], name: "index_spree_products_taxons_on_product_id"
|
463
|
+
t.index ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id"
|
464
|
+
end
|
465
|
+
|
466
|
+
create_table "spree_promotion_action_line_items", id: :serial, force: :cascade do |t|
|
467
|
+
t.integer "promotion_action_id"
|
468
|
+
t.integer "variant_id"
|
469
|
+
t.integer "quantity", default: 1
|
470
|
+
t.datetime "created_at", precision: 6
|
471
|
+
t.datetime "updated_at", precision: 6
|
472
|
+
t.index ["promotion_action_id"], name: "index_spree_promotion_action_line_items_on_promotion_action_id"
|
473
|
+
t.index ["variant_id"], name: "index_spree_promotion_action_line_items_on_variant_id"
|
474
|
+
end
|
475
|
+
|
476
|
+
create_table "spree_promotion_actions", id: :serial, force: :cascade do |t|
|
477
|
+
t.integer "promotion_id"
|
478
|
+
t.integer "position"
|
479
|
+
t.string "type"
|
480
|
+
t.datetime "deleted_at"
|
481
|
+
t.text "preferences"
|
482
|
+
t.datetime "created_at", precision: 6
|
483
|
+
t.datetime "updated_at", precision: 6
|
484
|
+
t.index ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at"
|
485
|
+
t.index ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type"
|
486
|
+
t.index ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id"
|
487
|
+
end
|
488
|
+
|
489
|
+
create_table "spree_promotion_categories", id: :serial, force: :cascade do |t|
|
490
|
+
t.string "name"
|
491
|
+
t.datetime "created_at", precision: 6
|
492
|
+
t.datetime "updated_at", precision: 6
|
493
|
+
t.string "code"
|
494
|
+
end
|
495
|
+
|
496
|
+
create_table "spree_promotion_code_batches", id: :serial, force: :cascade do |t|
|
497
|
+
t.integer "promotion_id", null: false
|
498
|
+
t.string "base_code", null: false
|
499
|
+
t.integer "number_of_codes", null: false
|
500
|
+
t.string "email"
|
501
|
+
t.string "error"
|
502
|
+
t.string "state", default: "pending"
|
503
|
+
t.datetime "created_at", precision: 6, null: false
|
504
|
+
t.datetime "updated_at", precision: 6, null: false
|
505
|
+
t.string "join_characters", default: "_", null: false
|
506
|
+
t.index ["promotion_id"], name: "index_spree_promotion_code_batches_on_promotion_id"
|
507
|
+
end
|
508
|
+
|
509
|
+
create_table "spree_promotion_codes", id: :serial, force: :cascade do |t|
|
510
|
+
t.integer "promotion_id", null: false
|
511
|
+
t.string "value", null: false
|
512
|
+
t.datetime "created_at", precision: 6
|
513
|
+
t.datetime "updated_at", precision: 6
|
514
|
+
t.integer "promotion_code_batch_id"
|
515
|
+
t.index ["promotion_code_batch_id"], name: "index_spree_promotion_codes_on_promotion_code_batch_id"
|
516
|
+
t.index ["promotion_id"], name: "index_spree_promotion_codes_on_promotion_id"
|
517
|
+
t.index ["value"], name: "index_spree_promotion_codes_on_value", unique: true
|
518
|
+
end
|
519
|
+
|
520
|
+
create_table "spree_promotion_rule_taxons", id: :serial, force: :cascade do |t|
|
521
|
+
t.integer "taxon_id"
|
522
|
+
t.integer "promotion_rule_id"
|
523
|
+
t.datetime "created_at", precision: 6
|
524
|
+
t.datetime "updated_at", precision: 6
|
525
|
+
t.index ["promotion_rule_id"], name: "index_spree_promotion_rule_taxons_on_promotion_rule_id"
|
526
|
+
t.index ["taxon_id"], name: "index_spree_promotion_rule_taxons_on_taxon_id"
|
527
|
+
end
|
528
|
+
|
529
|
+
create_table "spree_promotion_rules", id: :serial, force: :cascade do |t|
|
530
|
+
t.integer "promotion_id"
|
531
|
+
t.integer "product_group_id"
|
532
|
+
t.string "type"
|
533
|
+
t.datetime "created_at", precision: 6
|
534
|
+
t.datetime "updated_at", precision: 6
|
535
|
+
t.string "code"
|
536
|
+
t.text "preferences"
|
537
|
+
t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id"
|
538
|
+
t.index ["promotion_id"], name: "index_spree_promotion_rules_on_promotion_id"
|
539
|
+
end
|
540
|
+
|
541
|
+
create_table "spree_promotion_rules_stores", force: :cascade do |t|
|
542
|
+
t.bigint "store_id", null: false
|
543
|
+
t.bigint "promotion_rule_id", null: false
|
544
|
+
t.datetime "created_at", null: false
|
545
|
+
t.datetime "updated_at", null: false
|
546
|
+
t.index ["promotion_rule_id"], name: "index_spree_promotion_rules_stores_on_promotion_rule_id"
|
547
|
+
t.index ["store_id"], name: "index_spree_promotion_rules_stores_on_store_id"
|
548
|
+
end
|
549
|
+
|
550
|
+
create_table "spree_promotion_rules_users", id: :serial, force: :cascade do |t|
|
551
|
+
t.integer "user_id"
|
552
|
+
t.integer "promotion_rule_id"
|
553
|
+
t.datetime "created_at", precision: 6
|
554
|
+
t.datetime "updated_at", precision: 6
|
555
|
+
t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id"
|
556
|
+
t.index ["user_id"], name: "index_promotion_rules_users_on_user_id"
|
557
|
+
end
|
558
|
+
|
559
|
+
create_table "spree_promotions", id: :serial, force: :cascade do |t|
|
560
|
+
t.string "description"
|
561
|
+
t.datetime "expires_at"
|
562
|
+
t.datetime "starts_at"
|
563
|
+
t.string "name"
|
564
|
+
t.string "type"
|
565
|
+
t.integer "usage_limit"
|
566
|
+
t.string "match_policy", default: "all"
|
567
|
+
t.boolean "advertise", default: false
|
568
|
+
t.string "path"
|
569
|
+
t.datetime "created_at", precision: 6
|
570
|
+
t.datetime "updated_at", precision: 6
|
571
|
+
t.integer "promotion_category_id"
|
572
|
+
t.integer "per_code_usage_limit"
|
573
|
+
t.boolean "apply_automatically", default: false
|
574
|
+
t.index ["advertise"], name: "index_spree_promotions_on_advertise"
|
575
|
+
t.index ["apply_automatically"], name: "index_spree_promotions_on_apply_automatically"
|
576
|
+
t.index ["expires_at"], name: "index_spree_promotions_on_expires_at"
|
577
|
+
t.index ["id", "type"], name: "index_spree_promotions_on_id_and_type"
|
578
|
+
t.index ["promotion_category_id"], name: "index_spree_promotions_on_promotion_category_id"
|
579
|
+
t.index ["starts_at"], name: "index_spree_promotions_on_starts_at"
|
580
|
+
end
|
581
|
+
|
582
|
+
create_table "spree_properties", id: :serial, force: :cascade do |t|
|
583
|
+
t.string "name"
|
584
|
+
t.string "presentation", null: false
|
585
|
+
t.datetime "created_at", precision: 6
|
586
|
+
t.datetime "updated_at", precision: 6
|
587
|
+
end
|
588
|
+
|
589
|
+
create_table "spree_property_prototypes", id: :serial, force: :cascade do |t|
|
590
|
+
t.integer "prototype_id"
|
591
|
+
t.integer "property_id"
|
592
|
+
t.datetime "created_at", precision: 6
|
593
|
+
t.datetime "updated_at", precision: 6
|
594
|
+
end
|
595
|
+
|
596
|
+
create_table "spree_prototype_taxons", id: :serial, force: :cascade do |t|
|
597
|
+
t.integer "taxon_id"
|
598
|
+
t.integer "prototype_id"
|
599
|
+
t.datetime "created_at", precision: 6
|
600
|
+
t.datetime "updated_at", precision: 6
|
601
|
+
t.index ["prototype_id"], name: "index_spree_prototype_taxons_on_prototype_id"
|
602
|
+
t.index ["taxon_id"], name: "index_spree_prototype_taxons_on_taxon_id"
|
603
|
+
end
|
604
|
+
|
605
|
+
create_table "spree_prototypes", id: :serial, force: :cascade do |t|
|
606
|
+
t.string "name"
|
607
|
+
t.datetime "created_at", precision: 6
|
608
|
+
t.datetime "updated_at", precision: 6
|
609
|
+
end
|
610
|
+
|
611
|
+
create_table "spree_refund_reasons", id: :serial, force: :cascade do |t|
|
612
|
+
t.string "name"
|
613
|
+
t.boolean "active", default: true
|
614
|
+
t.boolean "mutable", default: true
|
615
|
+
t.datetime "created_at", precision: 6
|
616
|
+
t.datetime "updated_at", precision: 6
|
617
|
+
t.string "code"
|
618
|
+
end
|
619
|
+
|
620
|
+
create_table "spree_refunds", id: :serial, force: :cascade do |t|
|
621
|
+
t.integer "payment_id"
|
622
|
+
t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
|
623
|
+
t.string "transaction_id"
|
624
|
+
t.datetime "created_at", precision: 6
|
625
|
+
t.datetime "updated_at", precision: 6
|
626
|
+
t.integer "refund_reason_id"
|
627
|
+
t.integer "reimbursement_id"
|
628
|
+
t.index ["payment_id"], name: "index_spree_refunds_on_payment_id"
|
629
|
+
t.index ["refund_reason_id"], name: "index_refunds_on_refund_reason_id"
|
630
|
+
t.index ["reimbursement_id"], name: "index_spree_refunds_on_reimbursement_id"
|
631
|
+
end
|
632
|
+
|
633
|
+
create_table "spree_reimbursement_credits", id: :serial, force: :cascade do |t|
|
634
|
+
t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
|
635
|
+
t.integer "reimbursement_id"
|
636
|
+
t.integer "creditable_id"
|
637
|
+
t.string "creditable_type"
|
638
|
+
t.datetime "created_at", precision: 6
|
639
|
+
t.datetime "updated_at", precision: 6
|
640
|
+
end
|
641
|
+
|
642
|
+
create_table "spree_reimbursement_types", id: :serial, force: :cascade do |t|
|
643
|
+
t.string "name"
|
644
|
+
t.boolean "active", default: true
|
645
|
+
t.boolean "mutable", default: true
|
646
|
+
t.datetime "created_at", precision: 6
|
647
|
+
t.datetime "updated_at", precision: 6
|
648
|
+
t.string "type"
|
649
|
+
t.index ["type"], name: "index_spree_reimbursement_types_on_type"
|
650
|
+
end
|
651
|
+
|
652
|
+
create_table "spree_reimbursements", id: :serial, force: :cascade do |t|
|
653
|
+
t.string "number"
|
654
|
+
t.string "reimbursement_status"
|
655
|
+
t.integer "customer_return_id"
|
656
|
+
t.integer "order_id"
|
657
|
+
t.decimal "total", precision: 10, scale: 2
|
658
|
+
t.datetime "created_at", precision: 6
|
659
|
+
t.datetime "updated_at", precision: 6
|
660
|
+
t.index ["customer_return_id"], name: "index_spree_reimbursements_on_customer_return_id"
|
661
|
+
t.index ["order_id"], name: "index_spree_reimbursements_on_order_id"
|
662
|
+
end
|
663
|
+
|
664
|
+
create_table "spree_return_authorizations", id: :serial, force: :cascade do |t|
|
665
|
+
t.string "number"
|
666
|
+
t.string "state"
|
667
|
+
t.integer "order_id"
|
668
|
+
t.text "memo"
|
669
|
+
t.datetime "created_at", precision: 6
|
670
|
+
t.datetime "updated_at", precision: 6
|
671
|
+
t.integer "stock_location_id"
|
672
|
+
t.integer "return_reason_id"
|
673
|
+
t.index ["return_reason_id"], name: "index_return_authorizations_on_return_authorization_reason_id"
|
674
|
+
end
|
675
|
+
|
676
|
+
create_table "spree_return_items", id: :serial, force: :cascade do |t|
|
677
|
+
t.integer "return_authorization_id"
|
678
|
+
t.integer "inventory_unit_id"
|
679
|
+
t.integer "exchange_variant_id"
|
680
|
+
t.datetime "created_at", precision: 6
|
681
|
+
t.datetime "updated_at", precision: 6
|
682
|
+
t.decimal "amount", precision: 12, scale: 4, default: "0.0", null: false
|
683
|
+
t.decimal "included_tax_total", precision: 12, scale: 4, default: "0.0", null: false
|
684
|
+
t.decimal "additional_tax_total", precision: 12, scale: 4, default: "0.0", null: false
|
685
|
+
t.string "reception_status"
|
686
|
+
t.string "acceptance_status"
|
687
|
+
t.integer "customer_return_id"
|
688
|
+
t.integer "reimbursement_id"
|
689
|
+
t.integer "exchange_inventory_unit_id"
|
690
|
+
t.text "acceptance_status_errors"
|
691
|
+
t.integer "preferred_reimbursement_type_id"
|
692
|
+
t.integer "override_reimbursement_type_id"
|
693
|
+
t.boolean "resellable", default: true, null: false
|
694
|
+
t.integer "return_reason_id"
|
695
|
+
t.index ["customer_return_id"], name: "index_return_items_on_customer_return_id"
|
696
|
+
t.index ["exchange_inventory_unit_id"], name: "index_spree_return_items_on_exchange_inventory_unit_id"
|
697
|
+
end
|
698
|
+
|
699
|
+
create_table "spree_return_reasons", id: :serial, force: :cascade do |t|
|
700
|
+
t.string "name"
|
701
|
+
t.boolean "active", default: true
|
702
|
+
t.boolean "mutable", default: true
|
703
|
+
t.datetime "created_at", precision: 6
|
704
|
+
t.datetime "updated_at", precision: 6
|
705
|
+
end
|
706
|
+
|
707
|
+
create_table "spree_roles", id: :serial, force: :cascade do |t|
|
708
|
+
t.string "name"
|
709
|
+
t.datetime "created_at", precision: 6
|
710
|
+
t.datetime "updated_at", precision: 6
|
711
|
+
t.index ["name"], name: "index_spree_roles_on_name", unique: true
|
712
|
+
end
|
713
|
+
|
714
|
+
create_table "spree_roles_users", id: :serial, force: :cascade do |t|
|
715
|
+
t.integer "role_id"
|
716
|
+
t.integer "user_id"
|
717
|
+
t.datetime "created_at", precision: 6
|
718
|
+
t.datetime "updated_at", precision: 6
|
719
|
+
t.index ["role_id"], name: "index_spree_roles_users_on_role_id"
|
720
|
+
t.index ["user_id", "role_id"], name: "index_spree_roles_users_on_user_id_and_role_id", unique: true
|
721
|
+
t.index ["user_id"], name: "index_spree_roles_users_on_user_id"
|
722
|
+
end
|
723
|
+
|
724
|
+
create_table "spree_shipments", id: :serial, force: :cascade do |t|
|
725
|
+
t.string "tracking"
|
726
|
+
t.string "number"
|
727
|
+
t.decimal "cost", precision: 10, scale: 2, default: "0.0"
|
728
|
+
t.datetime "shipped_at"
|
729
|
+
t.integer "order_id"
|
730
|
+
t.integer "deprecated_address_id"
|
731
|
+
t.string "state"
|
732
|
+
t.datetime "created_at", precision: 6
|
733
|
+
t.datetime "updated_at", precision: 6
|
734
|
+
t.integer "stock_location_id"
|
735
|
+
t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0"
|
736
|
+
t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"
|
737
|
+
t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"
|
738
|
+
t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false
|
739
|
+
t.index ["deprecated_address_id"], name: "index_spree_shipments_on_deprecated_address_id"
|
740
|
+
t.index ["number"], name: "index_shipments_on_number"
|
741
|
+
t.index ["order_id"], name: "index_spree_shipments_on_order_id"
|
742
|
+
t.index ["stock_location_id"], name: "index_spree_shipments_on_stock_location_id"
|
743
|
+
end
|
744
|
+
|
745
|
+
create_table "spree_shipping_categories", id: :serial, force: :cascade do |t|
|
746
|
+
t.string "name"
|
747
|
+
t.datetime "created_at", precision: 6
|
748
|
+
t.datetime "updated_at", precision: 6
|
749
|
+
end
|
750
|
+
|
751
|
+
create_table "spree_shipping_method_categories", id: :serial, force: :cascade do |t|
|
752
|
+
t.integer "shipping_method_id", null: false
|
753
|
+
t.integer "shipping_category_id", null: false
|
754
|
+
t.datetime "created_at", precision: 6
|
755
|
+
t.datetime "updated_at", precision: 6
|
756
|
+
t.index ["shipping_category_id", "shipping_method_id"], name: "unique_spree_shipping_method_categories", unique: true
|
757
|
+
t.index ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id"
|
758
|
+
end
|
759
|
+
|
760
|
+
create_table "spree_shipping_method_stock_locations", id: :serial, force: :cascade do |t|
|
761
|
+
t.integer "shipping_method_id"
|
762
|
+
t.integer "stock_location_id"
|
763
|
+
t.datetime "created_at", precision: 6
|
764
|
+
t.datetime "updated_at", precision: 6
|
765
|
+
t.index ["shipping_method_id"], name: "shipping_method_id_spree_sm_sl"
|
766
|
+
t.index ["stock_location_id"], name: "sstock_location_id_spree_sm_sl"
|
767
|
+
end
|
768
|
+
|
769
|
+
create_table "spree_shipping_method_zones", id: :serial, force: :cascade do |t|
|
770
|
+
t.integer "shipping_method_id"
|
771
|
+
t.integer "zone_id"
|
772
|
+
t.datetime "created_at", precision: 6
|
773
|
+
t.datetime "updated_at", precision: 6
|
774
|
+
end
|
775
|
+
|
776
|
+
create_table "spree_shipping_methods", id: :serial, force: :cascade do |t|
|
777
|
+
t.string "name"
|
778
|
+
t.datetime "deleted_at"
|
779
|
+
t.datetime "created_at", precision: 6
|
780
|
+
t.datetime "updated_at", precision: 6
|
781
|
+
t.string "tracking_url"
|
782
|
+
t.string "admin_name"
|
783
|
+
t.integer "tax_category_id"
|
784
|
+
t.string "code"
|
785
|
+
t.boolean "available_to_all", default: true
|
786
|
+
t.string "carrier"
|
787
|
+
t.string "service_level"
|
788
|
+
t.boolean "available_to_users", default: true
|
789
|
+
t.index ["tax_category_id"], name: "index_spree_shipping_methods_on_tax_category_id"
|
790
|
+
end
|
791
|
+
|
792
|
+
create_table "spree_shipping_rate_taxes", id: :serial, force: :cascade do |t|
|
793
|
+
t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
|
794
|
+
t.integer "tax_rate_id"
|
795
|
+
t.integer "shipping_rate_id"
|
796
|
+
t.datetime "created_at", precision: 6, null: false
|
797
|
+
t.datetime "updated_at", precision: 6, null: false
|
798
|
+
t.index ["shipping_rate_id"], name: "index_spree_shipping_rate_taxes_on_shipping_rate_id"
|
799
|
+
t.index ["tax_rate_id"], name: "index_spree_shipping_rate_taxes_on_tax_rate_id"
|
800
|
+
end
|
801
|
+
|
802
|
+
create_table "spree_shipping_rates", id: :serial, force: :cascade do |t|
|
803
|
+
t.integer "shipment_id"
|
804
|
+
t.integer "shipping_method_id"
|
805
|
+
t.boolean "selected", default: false
|
806
|
+
t.decimal "cost", precision: 8, scale: 2, default: "0.0"
|
807
|
+
t.datetime "created_at", precision: 6
|
808
|
+
t.datetime "updated_at", precision: 6
|
809
|
+
t.integer "tax_rate_id"
|
810
|
+
t.index ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true
|
811
|
+
end
|
812
|
+
|
813
|
+
create_table "spree_state_changes", id: :serial, force: :cascade do |t|
|
814
|
+
t.string "name"
|
815
|
+
t.string "previous_state"
|
816
|
+
t.integer "stateful_id"
|
817
|
+
t.integer "user_id"
|
818
|
+
t.string "stateful_type"
|
819
|
+
t.string "next_state"
|
820
|
+
t.datetime "created_at", precision: 6
|
821
|
+
t.datetime "updated_at", precision: 6
|
822
|
+
t.index ["stateful_id", "stateful_type"], name: "index_spree_state_changes_on_stateful_id_and_stateful_type"
|
823
|
+
t.index ["user_id"], name: "index_spree_state_changes_on_user_id"
|
824
|
+
end
|
825
|
+
|
826
|
+
create_table "spree_states", id: :serial, force: :cascade do |t|
|
827
|
+
t.string "name"
|
828
|
+
t.string "abbr"
|
829
|
+
t.integer "country_id"
|
830
|
+
t.datetime "updated_at", precision: 6
|
831
|
+
t.datetime "created_at", precision: 6
|
832
|
+
t.index ["country_id"], name: "index_spree_states_on_country_id"
|
833
|
+
end
|
834
|
+
|
835
|
+
create_table "spree_stock_items", id: :serial, force: :cascade do |t|
|
836
|
+
t.integer "stock_location_id"
|
837
|
+
t.integer "variant_id"
|
838
|
+
t.integer "count_on_hand", default: 0, null: false
|
839
|
+
t.datetime "created_at", precision: 6
|
840
|
+
t.datetime "updated_at", precision: 6
|
841
|
+
t.boolean "backorderable", default: false
|
842
|
+
t.datetime "deleted_at"
|
843
|
+
t.index ["deleted_at"], name: "index_spree_stock_items_on_deleted_at"
|
844
|
+
t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id"
|
845
|
+
t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id"
|
846
|
+
t.index ["variant_id", "stock_location_id"], name: "index_spree_stock_items_on_variant_id_and_stock_location_id", unique: true, where: "(deleted_at IS NULL)"
|
847
|
+
end
|
848
|
+
|
849
|
+
create_table "spree_stock_locations", id: :serial, force: :cascade do |t|
|
850
|
+
t.string "name"
|
851
|
+
t.datetime "created_at", precision: 6
|
852
|
+
t.datetime "updated_at", precision: 6
|
853
|
+
t.boolean "default", default: false, null: false
|
854
|
+
t.string "address1"
|
855
|
+
t.string "address2"
|
856
|
+
t.string "city"
|
857
|
+
t.integer "state_id"
|
858
|
+
t.string "state_name"
|
859
|
+
t.integer "country_id"
|
860
|
+
t.string "zipcode"
|
861
|
+
t.string "phone"
|
862
|
+
t.boolean "active", default: true
|
863
|
+
t.boolean "backorderable_default", default: false
|
864
|
+
t.boolean "propagate_all_variants", default: true
|
865
|
+
t.string "admin_name"
|
866
|
+
t.integer "position", default: 0
|
867
|
+
t.boolean "restock_inventory", default: true, null: false
|
868
|
+
t.boolean "fulfillable", default: true, null: false
|
869
|
+
t.string "code"
|
870
|
+
t.boolean "check_stock_on_transfer", default: true
|
871
|
+
t.index ["country_id"], name: "index_spree_stock_locations_on_country_id"
|
872
|
+
t.index ["state_id"], name: "index_spree_stock_locations_on_state_id"
|
873
|
+
end
|
874
|
+
|
875
|
+
create_table "spree_stock_movements", id: :serial, force: :cascade do |t|
|
876
|
+
t.integer "stock_item_id"
|
877
|
+
t.integer "quantity", default: 0
|
878
|
+
t.string "action"
|
879
|
+
t.datetime "created_at", precision: 6, null: false
|
880
|
+
t.datetime "updated_at", precision: 6, null: false
|
881
|
+
t.string "originator_type"
|
882
|
+
t.integer "originator_id"
|
883
|
+
t.index ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id"
|
884
|
+
end
|
885
|
+
|
886
|
+
create_table "spree_store_credit_categories", id: :serial, force: :cascade do |t|
|
887
|
+
t.string "name"
|
888
|
+
t.datetime "created_at", precision: 6
|
889
|
+
t.datetime "updated_at", precision: 6
|
890
|
+
end
|
891
|
+
|
892
|
+
create_table "spree_store_credit_events", id: :serial, force: :cascade do |t|
|
893
|
+
t.integer "store_credit_id", null: false
|
894
|
+
t.string "action", null: false
|
895
|
+
t.decimal "amount", precision: 8, scale: 2
|
896
|
+
t.decimal "user_total_amount", precision: 8, scale: 2, default: "0.0", null: false
|
897
|
+
t.string "authorization_code", null: false
|
898
|
+
t.datetime "deleted_at"
|
899
|
+
t.string "originator_type"
|
900
|
+
t.integer "originator_id"
|
901
|
+
t.datetime "created_at", precision: 6
|
902
|
+
t.datetime "updated_at", precision: 6
|
903
|
+
t.decimal "amount_remaining", precision: 8, scale: 2
|
904
|
+
t.integer "store_credit_reason_id"
|
905
|
+
t.index ["deleted_at"], name: "index_spree_store_credit_events_on_deleted_at"
|
906
|
+
t.index ["store_credit_id"], name: "index_spree_store_credit_events_on_store_credit_id"
|
907
|
+
end
|
908
|
+
|
909
|
+
create_table "spree_store_credit_reasons", force: :cascade do |t|
|
910
|
+
t.string "name"
|
911
|
+
t.boolean "active", default: true
|
912
|
+
t.datetime "created_at", null: false
|
913
|
+
t.datetime "updated_at", null: false
|
914
|
+
end
|
915
|
+
|
916
|
+
create_table "spree_store_credit_types", id: :serial, force: :cascade do |t|
|
917
|
+
t.string "name"
|
918
|
+
t.integer "priority"
|
919
|
+
t.datetime "created_at", precision: 6
|
920
|
+
t.datetime "updated_at", precision: 6
|
921
|
+
t.index ["priority"], name: "index_spree_store_credit_types_on_priority"
|
922
|
+
end
|
923
|
+
|
924
|
+
create_table "spree_store_credits", id: :serial, force: :cascade do |t|
|
925
|
+
t.integer "user_id"
|
926
|
+
t.integer "category_id"
|
927
|
+
t.integer "created_by_id"
|
928
|
+
t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
|
929
|
+
t.decimal "amount_used", precision: 8, scale: 2, default: "0.0", null: false
|
930
|
+
t.decimal "amount_authorized", precision: 8, scale: 2, default: "0.0", null: false
|
931
|
+
t.string "currency"
|
932
|
+
t.text "memo"
|
933
|
+
t.datetime "deleted_at"
|
934
|
+
t.datetime "created_at", precision: 6
|
935
|
+
t.datetime "updated_at", precision: 6
|
936
|
+
t.integer "type_id"
|
937
|
+
t.datetime "invalidated_at"
|
938
|
+
t.index ["deleted_at"], name: "index_spree_store_credits_on_deleted_at"
|
939
|
+
t.index ["type_id"], name: "index_spree_store_credits_on_type_id"
|
940
|
+
t.index ["user_id"], name: "index_spree_store_credits_on_user_id"
|
941
|
+
end
|
942
|
+
|
943
|
+
create_table "spree_store_payment_methods", id: :serial, force: :cascade do |t|
|
944
|
+
t.integer "store_id", null: false
|
945
|
+
t.integer "payment_method_id", null: false
|
946
|
+
t.datetime "created_at", precision: 6, null: false
|
947
|
+
t.datetime "updated_at", precision: 6, null: false
|
948
|
+
t.index ["payment_method_id"], name: "index_spree_store_payment_methods_on_payment_method_id"
|
949
|
+
t.index ["store_id"], name: "index_spree_store_payment_methods_on_store_id"
|
950
|
+
end
|
951
|
+
|
952
|
+
create_table "spree_store_shipping_methods", force: :cascade do |t|
|
953
|
+
t.bigint "store_id", null: false
|
954
|
+
t.bigint "shipping_method_id", null: false
|
955
|
+
t.datetime "created_at", precision: 6, null: false
|
956
|
+
t.datetime "updated_at", precision: 6, null: false
|
957
|
+
t.index ["shipping_method_id"], name: "index_spree_store_shipping_methods_on_shipping_method_id"
|
958
|
+
t.index ["store_id"], name: "index_spree_store_shipping_methods_on_store_id"
|
959
|
+
end
|
960
|
+
|
961
|
+
create_table "spree_stores", id: :serial, force: :cascade do |t|
|
962
|
+
t.string "name"
|
963
|
+
t.string "url"
|
964
|
+
t.text "meta_description"
|
965
|
+
t.text "meta_keywords"
|
966
|
+
t.string "seo_title"
|
967
|
+
t.string "mail_from_address"
|
968
|
+
t.string "default_currency"
|
969
|
+
t.string "code"
|
970
|
+
t.boolean "default", default: false, null: false
|
971
|
+
t.datetime "created_at", precision: 6
|
972
|
+
t.datetime "updated_at", precision: 6
|
973
|
+
t.string "cart_tax_country_iso"
|
974
|
+
t.string "available_locales"
|
975
|
+
t.index ["code"], name: "index_spree_stores_on_code"
|
976
|
+
t.index ["default"], name: "index_spree_stores_on_default"
|
977
|
+
end
|
978
|
+
|
979
|
+
create_table "spree_tax_categories", id: :serial, force: :cascade do |t|
|
980
|
+
t.string "name"
|
981
|
+
t.string "description"
|
982
|
+
t.boolean "is_default", default: false
|
983
|
+
t.datetime "deleted_at"
|
984
|
+
t.datetime "created_at", precision: 6
|
985
|
+
t.datetime "updated_at", precision: 6
|
986
|
+
t.string "tax_code"
|
987
|
+
end
|
988
|
+
|
989
|
+
create_table "spree_tax_rate_tax_categories", id: :serial, force: :cascade do |t|
|
990
|
+
t.integer "tax_category_id", null: false
|
991
|
+
t.integer "tax_rate_id", null: false
|
992
|
+
t.index ["tax_category_id"], name: "index_spree_tax_rate_tax_categories_on_tax_category_id"
|
993
|
+
t.index ["tax_rate_id"], name: "index_spree_tax_rate_tax_categories_on_tax_rate_id"
|
994
|
+
end
|
995
|
+
|
996
|
+
create_table "spree_tax_rates", id: :serial, force: :cascade do |t|
|
997
|
+
t.decimal "amount", precision: 8, scale: 5
|
998
|
+
t.integer "zone_id"
|
999
|
+
t.boolean "included_in_price", default: false
|
1000
|
+
t.datetime "created_at", precision: 6
|
1001
|
+
t.datetime "updated_at", precision: 6
|
1002
|
+
t.string "name"
|
1003
|
+
t.boolean "show_rate_in_label", default: true
|
1004
|
+
t.datetime "deleted_at"
|
1005
|
+
t.datetime "starts_at"
|
1006
|
+
t.datetime "expires_at"
|
1007
|
+
t.index ["deleted_at"], name: "index_spree_tax_rates_on_deleted_at"
|
1008
|
+
t.index ["zone_id"], name: "index_spree_tax_rates_on_zone_id"
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
create_table "spree_taxonomies", id: :serial, force: :cascade do |t|
|
1012
|
+
t.string "name", null: false
|
1013
|
+
t.datetime "created_at", precision: 6
|
1014
|
+
t.datetime "updated_at", precision: 6
|
1015
|
+
t.integer "position", default: 0
|
1016
|
+
t.index ["position"], name: "index_spree_taxonomies_on_position"
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
create_table "spree_taxons", id: :serial, force: :cascade do |t|
|
1020
|
+
t.integer "parent_id"
|
1021
|
+
t.integer "position", default: 0
|
1022
|
+
t.string "name", null: false
|
1023
|
+
t.string "permalink"
|
1024
|
+
t.integer "taxonomy_id"
|
1025
|
+
t.integer "lft"
|
1026
|
+
t.integer "rgt"
|
1027
|
+
t.string "icon_file_name"
|
1028
|
+
t.string "icon_content_type"
|
1029
|
+
t.integer "icon_file_size"
|
1030
|
+
t.datetime "icon_updated_at"
|
1031
|
+
t.text "description"
|
1032
|
+
t.datetime "created_at", precision: 6
|
1033
|
+
t.datetime "updated_at", precision: 6
|
1034
|
+
t.string "meta_title"
|
1035
|
+
t.string "meta_description"
|
1036
|
+
t.string "meta_keywords"
|
1037
|
+
t.integer "depth"
|
1038
|
+
t.index ["lft"], name: "index_spree_taxons_on_lft"
|
1039
|
+
t.index ["parent_id"], name: "index_taxons_on_parent_id"
|
1040
|
+
t.index ["permalink"], name: "index_taxons_on_permalink"
|
1041
|
+
t.index ["position"], name: "index_spree_taxons_on_position"
|
1042
|
+
t.index ["rgt"], name: "index_spree_taxons_on_rgt"
|
1043
|
+
t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id"
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
create_table "spree_unit_cancels", id: :serial, force: :cascade do |t|
|
1047
|
+
t.integer "inventory_unit_id", null: false
|
1048
|
+
t.string "reason"
|
1049
|
+
t.string "created_by"
|
1050
|
+
t.datetime "created_at", precision: 6
|
1051
|
+
t.datetime "updated_at", precision: 6
|
1052
|
+
t.index ["inventory_unit_id"], name: "index_spree_unit_cancels_on_inventory_unit_id"
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
create_table "spree_user_addresses", id: :serial, force: :cascade do |t|
|
1056
|
+
t.integer "user_id", null: false
|
1057
|
+
t.integer "address_id", null: false
|
1058
|
+
t.boolean "default", default: false
|
1059
|
+
t.boolean "archived", default: false
|
1060
|
+
t.datetime "created_at", precision: 6, null: false
|
1061
|
+
t.datetime "updated_at", precision: 6, null: false
|
1062
|
+
t.index ["address_id"], name: "index_spree_user_addresses_on_address_id"
|
1063
|
+
t.index ["user_id", "address_id"], name: "index_spree_user_addresses_on_user_id_and_address_id", unique: true
|
1064
|
+
t.index ["user_id"], name: "index_spree_user_addresses_on_user_id"
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
create_table "spree_user_stock_locations", id: :serial, force: :cascade do |t|
|
1068
|
+
t.integer "user_id"
|
1069
|
+
t.integer "stock_location_id"
|
1070
|
+
t.datetime "created_at", precision: 6
|
1071
|
+
t.datetime "updated_at", precision: 6
|
1072
|
+
t.index ["user_id"], name: "index_spree_user_stock_locations_on_user_id"
|
1073
|
+
end
|
1074
|
+
|
1075
|
+
create_table "spree_users", id: :serial, force: :cascade do |t|
|
1076
|
+
t.string "encrypted_password", limit: 128
|
1077
|
+
t.string "password_salt", limit: 128
|
1078
|
+
t.string "email"
|
1079
|
+
t.string "remember_token"
|
1080
|
+
t.string "persistence_token"
|
1081
|
+
t.string "reset_password_token"
|
1082
|
+
t.string "perishable_token"
|
1083
|
+
t.integer "sign_in_count", default: 0, null: false
|
1084
|
+
t.integer "failed_attempts", default: 0, null: false
|
1085
|
+
t.datetime "last_request_at"
|
1086
|
+
t.datetime "current_sign_in_at"
|
1087
|
+
t.datetime "last_sign_in_at"
|
1088
|
+
t.string "current_sign_in_ip"
|
1089
|
+
t.string "last_sign_in_ip"
|
1090
|
+
t.string "login"
|
1091
|
+
t.integer "ship_address_id"
|
1092
|
+
t.integer "bill_address_id"
|
1093
|
+
t.datetime "created_at", precision: 6, null: false
|
1094
|
+
t.datetime "updated_at", precision: 6, null: false
|
1095
|
+
t.string "spree_api_key", limit: 48
|
1096
|
+
t.string "authentication_token"
|
1097
|
+
t.string "unlock_token"
|
1098
|
+
t.datetime "locked_at"
|
1099
|
+
t.datetime "remember_created_at"
|
1100
|
+
t.datetime "reset_password_sent_at"
|
1101
|
+
t.datetime "deleted_at"
|
1102
|
+
t.string "confirmation_token"
|
1103
|
+
t.datetime "confirmed_at"
|
1104
|
+
t.datetime "confirmation_sent_at"
|
1105
|
+
t.index ["deleted_at"], name: "index_spree_users_on_deleted_at"
|
1106
|
+
t.index ["email"], name: "email_idx_unique", unique: true
|
1107
|
+
t.index ["spree_api_key"], name: "index_spree_users_on_spree_api_key"
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
create_table "spree_variant_property_rule_conditions", id: :serial, force: :cascade do |t|
|
1111
|
+
t.integer "option_value_id"
|
1112
|
+
t.integer "variant_property_rule_id"
|
1113
|
+
t.datetime "created_at", precision: 6, null: false
|
1114
|
+
t.datetime "updated_at", precision: 6, null: false
|
1115
|
+
t.index ["variant_property_rule_id", "option_value_id"], name: "index_spree_variant_prop_rule_conditions_on_rule_and_optval"
|
1116
|
+
end
|
1117
|
+
|
1118
|
+
create_table "spree_variant_property_rule_values", id: :serial, force: :cascade do |t|
|
1119
|
+
t.text "value"
|
1120
|
+
t.integer "position", default: 0
|
1121
|
+
t.integer "property_id"
|
1122
|
+
t.integer "variant_property_rule_id"
|
1123
|
+
t.datetime "created_at", precision: 6
|
1124
|
+
t.datetime "updated_at", precision: 6
|
1125
|
+
t.index ["property_id"], name: "index_spree_variant_property_rule_values_on_property_id"
|
1126
|
+
t.index ["variant_property_rule_id"], name: "index_spree_variant_property_rule_values_on_rule"
|
1127
|
+
end
|
1128
|
+
|
1129
|
+
create_table "spree_variant_property_rules", id: :serial, force: :cascade do |t|
|
1130
|
+
t.integer "product_id"
|
1131
|
+
t.datetime "created_at", precision: 6, null: false
|
1132
|
+
t.datetime "updated_at", precision: 6, null: false
|
1133
|
+
t.index ["product_id"], name: "index_spree_variant_property_rules_on_product_id"
|
1134
|
+
end
|
1135
|
+
|
1136
|
+
create_table "spree_variants", id: :serial, force: :cascade do |t|
|
1137
|
+
t.string "sku", default: "", null: false
|
1138
|
+
t.decimal "weight", precision: 8, scale: 2, default: "0.0"
|
1139
|
+
t.decimal "height", precision: 8, scale: 2
|
1140
|
+
t.decimal "width", precision: 8, scale: 2
|
1141
|
+
t.decimal "depth", precision: 8, scale: 2
|
1142
|
+
t.datetime "deleted_at"
|
1143
|
+
t.boolean "is_master", default: false
|
1144
|
+
t.integer "product_id"
|
1145
|
+
t.decimal "cost_price", precision: 10, scale: 2
|
1146
|
+
t.integer "position"
|
1147
|
+
t.string "cost_currency"
|
1148
|
+
t.boolean "track_inventory", default: true
|
1149
|
+
t.integer "tax_category_id"
|
1150
|
+
t.datetime "updated_at", precision: 6
|
1151
|
+
t.datetime "created_at", precision: 6
|
1152
|
+
t.index ["position"], name: "index_spree_variants_on_position"
|
1153
|
+
t.index ["product_id"], name: "index_spree_variants_on_product_id"
|
1154
|
+
t.index ["sku"], name: "index_spree_variants_on_sku"
|
1155
|
+
t.index ["tax_category_id"], name: "index_spree_variants_on_tax_category_id"
|
1156
|
+
t.index ["track_inventory"], name: "index_spree_variants_on_track_inventory"
|
1157
|
+
end
|
1158
|
+
|
1159
|
+
create_table "spree_wallet_payment_sources", id: :serial, force: :cascade do |t|
|
1160
|
+
t.integer "user_id", null: false
|
1161
|
+
t.string "payment_source_type", null: false
|
1162
|
+
t.integer "payment_source_id", null: false
|
1163
|
+
t.boolean "default", default: false, null: false
|
1164
|
+
t.datetime "created_at", precision: 6, null: false
|
1165
|
+
t.datetime "updated_at", precision: 6, null: false
|
1166
|
+
t.index ["user_id", "payment_source_id", "payment_source_type"], name: "index_spree_wallet_payment_sources_on_source_and_user", unique: true
|
1167
|
+
t.index ["user_id"], name: "index_spree_wallet_payment_sources_on_user_id"
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
create_table "spree_zone_members", id: :serial, force: :cascade do |t|
|
1171
|
+
t.string "zoneable_type"
|
1172
|
+
t.integer "zoneable_id"
|
1173
|
+
t.integer "zone_id"
|
1174
|
+
t.datetime "created_at", precision: 6
|
1175
|
+
t.datetime "updated_at", precision: 6
|
1176
|
+
t.index ["zone_id"], name: "index_spree_zone_members_on_zone_id"
|
1177
|
+
t.index ["zoneable_id", "zoneable_type"], name: "index_spree_zone_members_on_zoneable_id_and_zoneable_type"
|
1178
|
+
end
|
1179
|
+
|
1180
|
+
create_table "spree_zones", id: :serial, force: :cascade do |t|
|
1181
|
+
t.string "name"
|
1182
|
+
t.string "description"
|
1183
|
+
t.integer "zone_members_count", default: 0
|
1184
|
+
t.datetime "created_at", precision: 6
|
1185
|
+
t.datetime "updated_at", precision: 6
|
1186
|
+
end
|
1187
|
+
|
1188
|
+
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
1189
|
+
add_foreign_key "spree_promotion_code_batches", "spree_promotions", column: "promotion_id"
|
1190
|
+
add_foreign_key "spree_promotion_codes", "spree_promotion_code_batches", column: "promotion_code_batch_id"
|
1191
|
+
add_foreign_key "spree_tax_rate_tax_categories", "spree_tax_categories", column: "tax_category_id"
|
1192
|
+
add_foreign_key "spree_tax_rate_tax_categories", "spree_tax_rates", column: "tax_rate_id"
|
1193
|
+
add_foreign_key "spree_wallet_payment_sources", "spree_users", column: "user_id"
|
1194
|
+
end
|