solidus_drip 0.0.1

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