Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Squash all Spree 4.3 migrations into one (#11353)
Damian Legawiec40679335a32a
diff --git a/bin/build-ci.rb b/bin/build-ci.rbindex 9964b40996..dd244094b0 100755--- a/bin/build-ci.rb+++ b/bin/build-ci.rb@@ -21,7 +21,7 @@ class Project@name = nameend- ALL = %w[api backend core frontend emails sample].map(&method(:new)).freeze+ ALL = %w[api backend core frontend emails].map(&method(:new)).freezeCORE_GEMS = %w[api core].freeze# Install subprojectdiff --git a/bin/build.sh b/bin/build.shindex 98719303c4..ba0b1673b4 100755--- a/bin/build.sh+++ b/bin/build.sh@@ -51,9 +51,3 @@ echo "* Setup Spree Emails and running RSpec..."echo "*******************************************"cd ../emails; prepare_app; bundle exec rspec spec-# Spree Sample-echo "*****************************************"-echo "* Setup Spree Sample and running RSpec..."-echo "*****************************************"-cd ../sample; prepare_app; bundle exec rspec spec-diff --git a/core/app/services/spree/seeds/all.rb b/core/app/services/spree/seeds/all.rbindex f25b75dc33..9e5132b217 100644--- a/core/app/services/spree/seeds/all.rb+++ b/core/app/services/spree/seeds/all.rb@@ -8,6 +8,7 @@ module SpreeDefaultReimbursementType.callRoles.callStates.call+ ShippingCategories.callStoreCreditCategories.callStores.callZones.calldiff --git a/core/app/services/spree/seeds/shipping_categories.rb b/core/app/services/spree/seeds/shipping_categories.rbnew file mode 100644index 0000000000..7e5526dff6--- /dev/null+++ b/core/app/services/spree/seeds/shipping_categories.rb@@ -0,0 +1,12 @@+module Spree+ module Seeds+ class ShippingCategories+ prepend Spree::ServiceModule::Base++ def call+ # FIXME: we should use translations here+ Spree::ShippingCategory.find_or_create_by!(name: 'Default')+ end+ end+ end+enddiff --git a/core/db/migrate/20120831092320_spree_one_two.rb b/core/db/migrate/20120831092320_spree_one_two.rbdeleted file mode 100644index 181a8b33f3..0000000000--- a/core/db/migrate/20120831092320_spree_one_two.rb+++ /dev/null@@ -1,481 +0,0 @@-class SpreeOneTwo < ActiveRecord::Migration[4.2]- def up- # This migration is just a compressed version of all the previous- # migrations for spree_core. Do not run it if one of the core tables- # already exists. Assume the best.- return if data_source_exists?(:spree_addresses)--- create_table :spree_activators do |t|- t.string :description- t.datetime :expires_at- t.datetime :starts_at- t.string :name- t.string :event_name- t.string :type- t.integer :usage_limit- t.string :match_policy, default: 'all'- t.string :code- t.boolean :advertise, default: false- t.string :path- t.timestamps null: false, precision: 6- end-- create_table :spree_addresses do |t|- t.string :firstname- t.string :lastname- t.string :address1- t.string :address2- t.string :city- t.string :zipcode- t.string :phone- t.string :state_name- t.string :alternative_phone- t.string :company- t.references :state- t.references :country- t.timestamps null: false, precision: 6- end-- add_index :spree_addresses, [:firstname], name: 'index_addresses_on_firstname'- add_index :spree_addresses, [:lastname], name: 'index_addresses_on_lastname'-- create_table :spree_adjustments do |t|- t.references :source, polymorphic: true- t.references :adjustable, polymorphic: true- t.references :originator, polymorphic: true- t.decimal :amount, precision: 8, scale: 2- t.string :label- t.boolean :mandatory- t.boolean :locked- t.boolean :eligible, default: true- t.timestamps null: false, precision: 6- end-- add_index :spree_adjustments, [:adjustable_id], name: 'index_adjustments_on_order_id'-- create_table :spree_assets do |t|- t.references :viewable, polymorphic: true- t.integer :attachment_width- t.integer :attachment_height- t.integer :attachment_file_size- t.integer :position- t.string :attachment_content_type- t.string :attachment_file_name- t.string :type, limit: 75- t.datetime :attachment_updated_at- t.text :alt- end-- add_index :spree_assets, [:viewable_id], name: 'index_assets_on_viewable_id'- add_index :spree_assets, [:viewable_type, :type], name: 'index_assets_on_viewable_type_and_type'-- create_table :spree_calculators do |t|- t.string :type- t.references :calculable, polymorphic: true- t.timestamps null: false, precision: 6- end-- create_table :spree_configurations do |t|- t.string :name- t.string :type, limit: 50- t.timestamps null: false, precision: 6- end-- add_index :spree_configurations, [:name, :type], name: 'index_spree_configurations_on_name_and_type'-- create_table :spree_countries do |t|- t.string :iso_name- t.string :iso- t.string :iso3- t.string :name- t.integer :numcode- end-- create_table :spree_credit_cards do |t|- t.string :month- t.string :year- t.string :cc_type- t.string :last_digits- t.string :first_name- t.string :last_name- t.string :start_month- t.string :start_year- t.string :issue_number- t.references :address- t.string :gateway_customer_profile_id- t.string :gateway_payment_profile_id- t.timestamps null: false, precision: 6- end-- create_table :spree_gateways do |t|- t.string :type- t.string :name- t.text :description- t.boolean :active, default: true- t.string :environment, default: 'development'- t.string :server, default: 'test'- t.boolean :test_mode, default: true- t.timestamps null: false, precision: 6- end-- create_table :spree_inventory_units do |t|- t.integer :lock_version, default: 0- t.string :state- t.references :variant- t.references :order- t.references :shipment- t.references :return_authorization- t.timestamps null: false, precision: 6- end-- add_index :spree_inventory_units, [:order_id], name: 'index_inventory_units_on_order_id'- add_index :spree_inventory_units, [:shipment_id], name: 'index_inventory_units_on_shipment_id'- add_index :spree_inventory_units, [:variant_id], name: 'index_inventory_units_on_variant_id'-- create_table :spree_line_items do |t|- t.references :variant- t.references :order- t.integer :quantity, null: false- t.decimal :price, precision: 8, scale: 2, null: false- t.timestamps null: false, precision: 6- end-- add_index :spree_line_items, [:order_id], name: 'index_spree_line_items_on_order_id'- add_index :spree_line_items, [:variant_id], name: 'index_spree_line_items_on_variant_id'-- create_table :spree_log_entries do |t|- t.references :source, polymorphic: true- t.text :details- t.timestamps null: false, precision: 6- end-- create_table :spree_mail_methods do |t|- t.string :environment- t.boolean :active, default: true- t.timestamps null: false, precision: 6- end-- create_table :spree_option_types do |t|- t.string :name, limit: 100- t.string :presentation, limit: 100- t.integer :position, default: 0, null: false- t.timestamps null: false, precision: 6- end-- create_table :spree_option_types_prototypes, id: false do |t|- t.references :prototype- t.references :option_type- end-- create_table :spree_option_values do |t|- t.integer :position- t.string :name- t.string :presentation- t.references :option_type- t.timestamps null: false, precision: 6- end-- create_table :spree_option_values_variants, id: false do |t|- t.references :variant- t.references :option_value- end-- add_index :spree_option_values_variants, [:variant_id, :option_value_id], name: 'index_option_values_variants_on_variant_id_and_option_value_id'- add_index :spree_option_values_variants, [:variant_id], name: 'index_spree_option_values_variants_on_variant_id'-- create_table :spree_orders do |t|- t.string :number, limit: 15- t.decimal :item_total, precision: 8, scale: 2, default: 0.0, null: false- t.decimal :total, precision: 8, scale: 2, default: 0.0, null: false- t.string :state- t.decimal :adjustment_total, precision: 8, scale: 2, default: 0.0, null: false- t.references :user- t.datetime :completed_at- t.references :bill_address- t.references :ship_address- t.decimal :payment_total, precision: 8, scale: 2, default: 0.0- t.references :shipping_method- t.string :shipment_state- t.string :payment_state- t.string :email- t.text :special_instructions- t.timestamps null: false, precision: 6- end-- add_index :spree_orders, [:number], name: 'index_spree_orders_on_number'-- create_table :spree_payment_methods do |t|- t.string :type- t.string :name- t.text :description- t.boolean :active, default: true- t.string :environment, default: 'development'- t.datetime :deleted_at- t.string :display_on- t.timestamps null: false, precision: 6- end-- create_table :spree_payments do |t|- t.decimal :amount, precision: 8, scale: 2, default: 0.0, null: false- t.references :order- t.references :source, polymorphic: true- t.references :payment_method- t.string :state- t.string :response_code- t.string :avs_response- t.timestamps null: false, precision: 6- end-- create_table :spree_preferences do |t|- t.string :name, limit: 100- t.references :owner, polymorphic: true- t.text :value- t.string :key- t.string :value_type- t.timestamps null: false, precision: 6- end-- add_index :spree_preferences, [:key], name: 'index_spree_preferences_on_key', unique: true-- create_table :spree_product_option_types do |t|- t.integer :position- t.references :product- t.references :option_type- t.timestamps null: false, precision: 6- end-- create_table :spree_product_properties do |t|- t.string :value- t.references :product- t.references :property- t.timestamps null: false, precision: 6- end-- add_index :spree_product_properties, [:product_id], name: 'index_product_properties_on_product_id'-- create_table :spree_products do |t|- t.string :name, default: '', null: false- t.text :description- t.datetime :available_on- t.datetime :deleted_at- t.string :permalink- t.string :meta_description- t.string :meta_keywords- t.references :tax_category- t.references :shipping_category- t.integer :count_on_hand, default: 0, null: false- t.timestamps null: false, precision: 6- end-- add_index :spree_products, [:available_on], name: 'index_spree_products_on_available_on'- add_index :spree_products, [:deleted_at], name: 'index_spree_products_on_deleted_at'- add_index :spree_products, [:name], name: 'index_spree_products_on_name'- add_index :spree_products, [:permalink], name: 'index_spree_products_on_permalink'-- create_table :spree_products_taxons, id: false do |t|- t.references :product- t.references :taxon- end-- add_index :spree_products_taxons, [:product_id], name: 'index_spree_products_taxons_on_product_id'- add_index :spree_products_taxons, [:taxon_id], name: 'index_spree_products_taxons_on_taxon_id'-- create_table :spree_properties do |t|- t.string :name- t.string :presentation, null: false- t.timestamps null: false, precision: 6- end-- create_table :spree_properties_prototypes, id: false do |t|- t.references :prototype- t.references :property- end-- create_table :spree_prototypes do |t|- t.string :name- t.timestamps null: false, precision: 6- end-- create_table :spree_return_authorizations do |t|- t.string :number- t.string :state- t.decimal :amount, precision: 8, scale: 2, default: 0.0, null: false- t.references :order- t.text :reason- t.timestamps null: false, precision: 6- end-- create_table :spree_roles do |t|- t.string :name- end-- create_table :spree_roles_users, id: false do |t|- t.references :role- t.references :user- end-- add_index :spree_roles_users, [:role_id], name: 'index_spree_roles_users_on_role_id'- add_index :spree_roles_users, [:user_id], name: 'index_spree_roles_users_on_user_id'-- create_table :spree_shipments do |t|- t.string :tracking- t.string :number- t.decimal :cost, precision: 8, scale: 2- t.datetime :shipped_at- t.references :order- t.references :shipping_method- t.references :address- t.string :state- t.timestamps null: false, precision: 6- end-- add_index :spree_shipments, [:number], name: 'index_shipments_on_number'-- create_table :spree_shipping_categories do |t|- t.string :name- t.timestamps null: false, precision: 6- end-- create_table :spree_shipping_methods do |t|- t.string :name- t.references :zone- t.string :display_on- t.references :shipping_category- t.boolean :match_none- t.boolean :match_all- t.boolean :match_one- t.datetime :deleted_at- t.timestamps null: false, precision: 6- end-- create_table :spree_state_changes do |t|- t.string :name- t.string :previous_state- t.references :stateful- t.references :user- t.string :stateful_type- t.string :next_state- t.timestamps null: false, precision: 6- end-- create_table :spree_states do |t|- t.string :name- t.string :abbr- t.references :country- end-- create_table :spree_tax_categories do |t|- t.string :name- t.string :description- t.boolean :is_default, default: false- t.datetime :deleted_at- t.timestamps null: false, precision: 6- end-- create_table :spree_tax_rates do |t|- t.decimal :amount, precision: 8, scale: 5- t.references :zone- t.references :tax_category- t.boolean :included_in_price, default: false- t.timestamps null: false, precision: 6- end-- create_table :spree_taxonomies do |t|- t.string :name, null: false- t.timestamps null: false, precision: 6- end-- create_table :spree_taxons do |t|- t.references :parent- t.integer :position, default: 0- t.string :name, null: false- t.string :permalink- t.references :taxonomy- t.integer :lft- t.integer :rgt- t.string :icon_file_name- t.string :icon_content_type- t.integer :icon_file_size- t.datetime :icon_updated_at- t.text :description- t.timestamps null: false, precision: 6- end-- add_index :spree_taxons, [:parent_id], name: 'index_taxons_on_parent_id'- add_index :spree_taxons, [:permalink], name: 'index_taxons_on_permalink'- add_index :spree_taxons, [:taxonomy_id], name: 'index_taxons_on_taxonomy_id'-- create_table :spree_tokenized_permissions, force: true do |t|- t.references :permissable, polymorphic: true- t.string :token- t.timestamps null: false, precision: 6- end-- add_index :spree_tokenized_permissions, [:permissable_id, :permissable_type], name: 'index_tokenized_name_and_type'-- create_table :spree_trackers do |t|- t.string :environment- t.string :analytics_id- t.boolean :active, default: true- t.timestamps null: false, precision: 6- end-- create_table :spree_users do |t|- t.string :encrypted_password, limit: 128- t.string :password_salt, limit: 128- t.string :email- t.string :remember_token- t.string :persistence_token- t.string :reset_password_token- t.string :perishable_token- t.integer :sign_in_count, default: 0, null: false- t.integer :failed_attempts, default: 0, null: false- t.datetime :last_request_at- t.datetime :current_sign_in_at- t.datetime :last_sign_in_at- t.string :current_sign_in_ip- t.string :last_sign_in_ip- t.string :login- t.references :ship_address- t.references :bill_address- t.string :authentication_token- t.string :unlock_token- t.datetime :locked_at- t.datetime :remember_created_at- t.datetime :reset_password_sent_at- t.timestamps null: false, precision: 6- end-- create_table :spree_variants do |t|- t.string :sku, default: '', null: false- t.decimal :price, precision: 8, scale: 2, null: false- t.decimal :weight, precision: 8, scale: 2- t.decimal :height, precision: 8, scale: 2- t.decimal :width, precision: 8, scale: 2- t.decimal :depth, precision: 8, scale: 2- t.datetime :deleted_at- t.boolean :is_master, default: false- t.references :product- t.integer :count_on_hand, default: 0, null: false- t.decimal :cost_price, precision: 8, scale: 2- t.integer :position- end-- add_index :spree_variants, [:product_id], name: 'index_spree_variants_on_product_id'-- create_table :spree_zone_members do |t|- t.references :zoneable, polymorphic: true- t.references :zone- t.timestamps null: false, precision: 6- end-- create_table :spree_zones do |t|- t.string :name- t.string :description- t.boolean :default_tax, default: false- t.integer :zone_members_count, default: 0- t.timestamps null: false, precision: 6- end- end-enddiff --git a/core/db/migrate/20120831092359_spree_promo_one_two.rb b/core/db/migrate/20120831092359_spree_promo_one_two.rbdeleted file mode 100644index 53d55603b9..0000000000--- a/core/db/migrate/20120831092359_spree_promo_one_two.rb+++ /dev/null@@ -1,45 +0,0 @@-class SpreePromoOneTwo < ActiveRecord::Migration[4.2]- def up- # This migration is just a compressed migration for all previous versions of spree_promo- return if data_source_exists?(:spree_products_promotion_rules)-- create_table :spree_products_promotion_rules, id: false, force: true do |t|- t.references :product- t.references :promotion_rule- end-- add_index :spree_products_promotion_rules, [:product_id], name: 'index_products_promotion_rules_on_product_id'- add_index :spree_products_promotion_rules, [:promotion_rule_id], name: 'index_products_promotion_rules_on_promotion_rule_id'-- create_table :spree_promotion_action_line_items, force: true do |t|- t.references :promotion_action- t.references :variant- t.integer :quantity, default: 1- end-- create_table :spree_promotion_actions, force: true do |t|- t.references :activator- t.integer :position- t.string :type- end-- create_table :spree_promotion_rules, force: true do |t|- t.references :activator- t.references :user- t.references :product_group- t.string :type- t.timestamps null: false, precision: 6- end-- add_index :spree_promotion_rules, [:product_group_id], name: 'index_promotion_rules_on_product_group_id'- add_index :spree_promotion_rules, [:user_id], name: 'index_promotion_rules_on_user_id'-- create_table :spree_promotion_rules_users, id: false, force: true do |t|- t.references :user- t.references :promotion_rule- end-- add_index :spree_promotion_rules_users, [:promotion_rule_id], name: 'index_promotion_rules_users_on_promotion_rule_id'- add_index :spree_promotion_rules_users, [:user_id], name: 'index_promotion_rules_users_on_user_id'- end-enddiff --git a/core/db/migrate/20120905145253_add_tax_rate_label.rb b/core/db/migrate/20120905145253_add_tax_rate_label.rbdeleted file mode 100644index b264947efa..0000000000--- a/core/db/migrate/20120905145253_add_tax_rate_label.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddTaxRateLabel < ActiveRecord::Migration[4.2]- def change- add_column :spree_tax_rates, :name, :string- end-enddiff --git a/core/db/migrate/20120905151823_add_toggle_tax_rate_display.rb b/core/db/migrate/20120905151823_add_toggle_tax_rate_display.rbdeleted file mode 100644index 0a227804f8..0000000000--- a/core/db/migrate/20120905151823_add_toggle_tax_rate_display.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddToggleTaxRateDisplay < ActiveRecord::Migration[4.2]- def change- add_column :spree_tax_rates, :show_rate_in_label, :boolean, default: true- end-enddiff --git a/core/db/migrate/20120929093553_remove_unused_preference_columns.rb b/core/db/migrate/20120929093553_remove_unused_preference_columns.rbdeleted file mode 100644index d4ee5d7591..0000000000--- a/core/db/migrate/20120929093553_remove_unused_preference_columns.rb+++ /dev/null@@ -1,8 +0,0 @@-class RemoveUnusedPreferenceColumns < ActiveRecord::Migration[4.2]- def change- # Columns have already been removed if the application was upgraded from an older version, but must be removed from new apps.- remove_column :spree_preferences, :name if ApplicationRecord.connection.column_exists?(:spree_preferences, :name)- remove_column :spree_preferences, :owner_id if ApplicationRecord.connection.column_exists?(:spree_preferences, :owner_id)- remove_column :spree_preferences, :owner_type if ApplicationRecord.connection.column_exists?(:spree_preferences, :owner_type)- end-enddiff --git a/core/db/migrate/20121009142519_add_lock_version_to_variant.rb b/core/db/migrate/20121009142519_add_lock_version_to_variant.rbdeleted file mode 100644index d2ec250180..0000000000--- a/core/db/migrate/20121009142519_add_lock_version_to_variant.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddLockVersionToVariant < ActiveRecord::Migration[4.2]- def change- add_column :spree_variants, :lock_version, :integer, default: 0- end-enddiff --git a/core/db/migrate/20121010142909_add_states_required_to_countries.rb b/core/db/migrate/20121010142909_add_states_required_to_countries.rbdeleted file mode 100644index 2344461288..0000000000--- a/core/db/migrate/20121010142909_add_states_required_to_countries.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddStatesRequiredToCountries < ActiveRecord::Migration[4.2]- def change- add_column :spree_countries, :states_required, :boolean, default: true- end-enddiff --git a/core/db/migrate/20121012071449_add_on_demand_to_product_and_variant.rb b/core/db/migrate/20121012071449_add_on_demand_to_product_and_variant.rbdeleted file mode 100644index 16511c0792..0000000000--- a/core/db/migrate/20121012071449_add_on_demand_to_product_and_variant.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddOnDemandToProductAndVariant < ActiveRecord::Migration[4.2]- def change- add_column :spree_products, :on_demand, :boolean, default: false- add_column :spree_variants, :on_demand, :boolean, default: false- end-enddiff --git a/core/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb b/core/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rbdeleted file mode 100644index 3792e20c1b..0000000000--- a/core/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb+++ /dev/null@@ -1,11 +0,0 @@-class RemoveNotNullConstraintFromProductsOnHand < ActiveRecord::Migration[4.2]- def up- change_column :spree_products, :count_on_hand, :integer, null: true- change_column :spree_variants, :count_on_hand, :integer, null: true- end-- def down- change_column :spree_products, :count_on_hand, :integer, null: false- change_column :spree_variants, :count_on_hand, :integer, null: false- end-enddiff --git a/core/db/migrate/20121031162139_split_prices_from_variants.rb b/core/db/migrate/20121031162139_split_prices_from_variants.rbdeleted file mode 100644index b4c10407ae..0000000000--- a/core/db/migrate/20121031162139_split_prices_from_variants.rb+++ /dev/null@@ -1,31 +0,0 @@-class SplitPricesFromVariants < ActiveRecord::Migration[4.2]- def up- create_table :spree_prices do |t|- t.integer :variant_id, null: false- t.decimal :amount, precision: 8, scale: 2, null: false- t.string :currency- end-- Spree::Variant.all.each do |variant|- Spree::Price.create!(- variant_id: variant.id,- amount: variant[:price],- currency: Spree::Config[:currency]- )- end-- remove_column :spree_variants, :price- end-- def down- prices = ApplicationRecord.connection.execute("select variant_id, amount from spree_prices")- add_column :spree_variants, :price, :decimal, after: :sku, scale: 2, precision: 8-- prices.each do |price|- ApplicationRecord.connection.execute("update spree_variants set price = #{price['amount']} where id = #{price['variant_id']}")- end-- change_column :spree_variants, :price, :decimal, after: :sku, scale: 2, precision: 8, null: false- drop_table :spree_prices- end-enddiff --git a/core/db/migrate/20121107003422_remove_not_null_from_spree_prices_amount.rb b/core/db/migrate/20121107003422_remove_not_null_from_spree_prices_amount.rbdeleted file mode 100644index 6770570fbc..0000000000--- a/core/db/migrate/20121107003422_remove_not_null_from_spree_prices_amount.rb+++ /dev/null@@ -1,9 +0,0 @@-class RemoveNotNullFromSpreePricesAmount < ActiveRecord::Migration[4.2]- def up- change_column :spree_prices, :amount, :decimal, precision: 8, scale: 2, null: true- end-- def down- change_column :spree_prices, :amount, :decimal, precision: 8, scale: 2, null: false- end-enddiff --git a/core/db/migrate/20121107184631_add_currency_to_line_items.rb b/core/db/migrate/20121107184631_add_currency_to_line_items.rbdeleted file mode 100644index 070861da18..0000000000--- a/core/db/migrate/20121107184631_add_currency_to_line_items.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCurrencyToLineItems < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :currency, :string- end-enddiff --git a/core/db/migrate/20121107194006_add_currency_to_orders.rb b/core/db/migrate/20121107194006_add_currency_to_orders.rbdeleted file mode 100644index 858542f18a..0000000000--- a/core/db/migrate/20121107194006_add_currency_to_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCurrencyToOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :currency, :string- end-enddiff --git a/core/db/migrate/20121109173623_add_cost_currency_to_variants.rb b/core/db/migrate/20121109173623_add_cost_currency_to_variants.rbdeleted file mode 100644index 479f8c308e..0000000000--- a/core/db/migrate/20121109173623_add_cost_currency_to_variants.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCostCurrencyToVariants < ActiveRecord::Migration[4.2]- def change- add_column :spree_variants, :cost_currency, :string, after: :cost_price- end-enddiff --git a/core/db/migrate/20121111231553_remove_display_on_from_payment_methods.rb b/core/db/migrate/20121111231553_remove_display_on_from_payment_methods.rbdeleted file mode 100644index 795da35415..0000000000--- a/core/db/migrate/20121111231553_remove_display_on_from_payment_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class RemoveDisplayOnFromPaymentMethods < ActiveRecord::Migration[4.2]- def up- remove_column :spree_payment_methods, :display_on- end-enddiff --git a/core/db/migrate/20121124203911_add_position_to_taxonomies.rb b/core/db/migrate/20121124203911_add_position_to_taxonomies.rbdeleted file mode 100644index 4be2df595d..0000000000--- a/core/db/migrate/20121124203911_add_position_to_taxonomies.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddPositionToTaxonomies < ActiveRecord::Migration[4.2]- def change- add_column :spree_taxonomies, :position, :integer, default: 0- end-enddiff --git a/core/db/migrate/20121126040517_add_last_ip_to_spree_orders.rb b/core/db/migrate/20121126040517_add_last_ip_to_spree_orders.rbdeleted file mode 100644index 1c8996eb3c..0000000000--- a/core/db/migrate/20121126040517_add_last_ip_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddLastIpToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :last_ip_address, :string- end-enddiff --git a/core/db/migrate/20121213162028_add_state_to_spree_adjustments.rb b/core/db/migrate/20121213162028_add_state_to_spree_adjustments.rbdeleted file mode 100644index 06c25d96e9..0000000000--- a/core/db/migrate/20121213162028_add_state_to_spree_adjustments.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddStateToSpreeAdjustments < ActiveRecord::Migration[4.2]- def change- add_column :spree_adjustments, :state, :string- remove_column :spree_adjustments, :locked- end-enddiff --git a/core/db/migrate/20130114053446_add_display_on_to_spree_payment_methods.rb b/core/db/migrate/20130114053446_add_display_on_to_spree_payment_methods.rbdeleted file mode 100644index 5b59d1d8ea..0000000000--- a/core/db/migrate/20130114053446_add_display_on_to_spree_payment_methods.rb+++ /dev/null@@ -1,9 +0,0 @@-class AddDisplayOnToSpreePaymentMethods < ActiveRecord::Migration[4.2]- def self.up- add_column :spree_payment_methods, :display_on, :string- end-- def self.down- remove_column :spree_payment_methods, :display_on- end-enddiff --git a/core/db/migrate/20130120201805_add_position_to_product_properties.spree.rb b/core/db/migrate/20130120201805_add_position_to_product_properties.spree.rbdeleted file mode 100644index 72a76fabe8..0000000000--- a/core/db/migrate/20130120201805_add_position_to_product_properties.spree.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddPositionToProductProperties < ActiveRecord::Migration[4.2]- def change- add_column :spree_product_properties, :position, :integer, default: 0- end-end-diff --git a/core/db/migrate/20130203232234_add_identifier_to_spree_payments.rb b/core/db/migrate/20130203232234_add_identifier_to_spree_payments.rbdeleted file mode 100644index 8eb9d45df1..0000000000--- a/core/db/migrate/20130203232234_add_identifier_to_spree_payments.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIdentifierToSpreePayments < ActiveRecord::Migration[4.2]- def change- add_column :spree_payments, :identifier, :string- end-enddiff --git a/core/db/migrate/20130207155350_add_order_id_index_to_payments.rb b/core/db/migrate/20130207155350_add_order_id_index_to_payments.rbdeleted file mode 100644index 90c7fe7f36..0000000000--- a/core/db/migrate/20130207155350_add_order_id_index_to_payments.rb+++ /dev/null@@ -1,9 +0,0 @@-class AddOrderIdIndexToPayments < ActiveRecord::Migration[4.2]- def self.up- add_index :spree_payments, :order_id- end-- def self.down- remove_index :spree_payments, :order_id- end-enddiff --git a/core/db/migrate/20130208032954_add_primary_to_spree_products_taxons.rb b/core/db/migrate/20130208032954_add_primary_to_spree_products_taxons.rbdeleted file mode 100644index 832973e5d7..0000000000--- a/core/db/migrate/20130208032954_add_primary_to_spree_products_taxons.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddPrimaryToSpreeProductsTaxons < ActiveRecord::Migration[4.2]- def change- add_column :spree_products_taxons, :id, :primary_key- end-enddiff --git a/core/db/migrate/20130211190146_create_spree_stock_items.rb b/core/db/migrate/20130211190146_create_spree_stock_items.rbdeleted file mode 100644index 835b5324e5..0000000000--- a/core/db/migrate/20130211190146_create_spree_stock_items.rb+++ /dev/null@@ -1,14 +0,0 @@-class CreateSpreeStockItems < ActiveRecord::Migration[4.2]- def change- create_table :spree_stock_items do |t|- t.belongs_to :stock_location- t.belongs_to :variant- t.integer :count_on_hand, null: false, default: 0- t.integer :lock_version-- t.timestamps null: false, precision: 6- end- add_index :spree_stock_items, :stock_location_id- add_index :spree_stock_items, [:stock_location_id, :variant_id], name: 'stock_item_by_loc_and_var_id'- end-enddiff --git a/core/db/migrate/20130211191120_create_spree_stock_locations.rb b/core/db/migrate/20130211191120_create_spree_stock_locations.rbdeleted file mode 100644index 725ed24f66..0000000000--- a/core/db/migrate/20130211191120_create_spree_stock_locations.rb+++ /dev/null@@ -1,11 +0,0 @@-class CreateSpreeStockLocations < ActiveRecord::Migration[4.2]- def change- create_table :spree_stock_locations do |t|- t.string :name- t.belongs_to :address-- t.timestamps null: false, precision: 6- end- add_index :spree_stock_locations, :address_id- end-enddiff --git a/core/db/migrate/20130213191427_create_default_stock.rb b/core/db/migrate/20130213191427_create_default_stock.rbdeleted file mode 100644index ce3ac95bb1..0000000000--- a/core/db/migrate/20130213191427_create_default_stock.rb+++ /dev/null@@ -1,33 +0,0 @@-class CreateDefaultStock < ActiveRecord::Migration[4.2]- def up- unless column_exists? :spree_stock_locations, :default- add_column :spree_stock_locations, :default, :boolean, null: false, default: false- end-- Spree::StockLocation.skip_callback(:create, :after, :create_stock_items)- Spree::StockLocation.skip_callback(:save, :after, :ensure_one_default)- location = Spree::StockLocation.new(name: 'default')- location.save(validate: false)-- Spree::Variant.find_each do |variant|- stock_item = Spree::StockItem.unscoped.build(stock_location: location, variant: variant)- stock_item.send(:count_on_hand=, variant.count_on_hand)- # Avoid running default_scope defined by acts_as_paranoid, related to #3805,- # validations would run a query with a delete_at column that might not be present yet- stock_item.save! validate: false- end-- remove_column :spree_variants, :count_on_hand- end-- def down- add_column :spree_variants, :count_on_hand, :integer-- Spree::StockItem.find_each do |stock_item|- stock_item.variant.update_column :count_on_hand, stock_item.count_on_hand- end-- Spree::StockLocation.delete_all- Spree::StockItem.delete_all- end-enddiff --git a/core/db/migrate/20130222032153_add_order_id_index_to_shipments.rb b/core/db/migrate/20130222032153_add_order_id_index_to_shipments.rbdeleted file mode 100644index 5b21223cfd..0000000000--- a/core/db/migrate/20130222032153_add_order_id_index_to_shipments.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddOrderIdIndexToShipments < ActiveRecord::Migration[4.2]- def change- add_index :spree_shipments, :order_id- end-enddiff --git a/core/db/migrate/20130226032817_change_meta_description_on_spree_products_to_text.rb b/core/db/migrate/20130226032817_change_meta_description_on_spree_products_to_text.rbdeleted file mode 100644index ee1c5d213a..0000000000--- a/core/db/migrate/20130226032817_change_meta_description_on_spree_products_to_text.rb+++ /dev/null@@ -1,5 +0,0 @@-class ChangeMetaDescriptionOnSpreeProductsToText < ActiveRecord::Migration[4.2]- def change- change_column :spree_products, :meta_description, :text, limit: nil- end-enddiff --git a/core/db/migrate/20130226191231_add_stock_location_id_to_spree_shipments.rb b/core/db/migrate/20130226191231_add_stock_location_id_to_spree_shipments.rbdeleted file mode 100644index e576eb334a..0000000000--- a/core/db/migrate/20130226191231_add_stock_location_id_to_spree_shipments.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddStockLocationIdToSpreeShipments < ActiveRecord::Migration[4.2]- def change- add_column :spree_shipments, :stock_location_id, :integer- end-enddiff --git a/core/db/migrate/20130227143905_add_pending_to_inventory_unit.rb b/core/db/migrate/20130227143905_add_pending_to_inventory_unit.rbdeleted file mode 100644index d65d80bc87..0000000000--- a/core/db/migrate/20130227143905_add_pending_to_inventory_unit.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddPendingToInventoryUnit < ActiveRecord::Migration[4.2]- def change- add_column :spree_inventory_units, :pending, :boolean, default: true- Spree::InventoryUnit.update_all(pending: false)- end-enddiff --git a/core/db/migrate/20130228164411_remove_on_demand_from_product_and_variant.rb b/core/db/migrate/20130228164411_remove_on_demand_from_product_and_variant.rbdeleted file mode 100644index da92fe176f..0000000000--- a/core/db/migrate/20130228164411_remove_on_demand_from_product_and_variant.rb+++ /dev/null@@ -1,6 +0,0 @@-class RemoveOnDemandFromProductAndVariant < ActiveRecord::Migration[4.2]- def change- remove_column :spree_products, :on_demand- remove_column :spree_variants, :on_demand- end-enddiff --git a/core/db/migrate/20130228210442_create_shipping_method_zone.rb b/core/db/migrate/20130228210442_create_shipping_method_zone.rbdeleted file mode 100644index ee328e81de..0000000000--- a/core/db/migrate/20130228210442_create_shipping_method_zone.rb+++ /dev/null@@ -1,21 +0,0 @@-class CreateShippingMethodZone < ActiveRecord::Migration[4.2]- class ShippingMethodZone < ApplicationRecord- self.table_name = 'shipping_methods_zones'- end- def up- create_table :shipping_methods_zones, id: false do |t|- t.integer :shipping_method_id- t.integer :zone_id- end- Spree::ShippingMethod.all.each do |sm|- ShippingMethodZone.create!(zone_id: sm.zone_id, shipping_method_id: sm.id)- end-- remove_column :spree_shipping_methods, :zone_id- end-- def down- drop_table :shipping_methods_zones- add_column :spree_shipping_methods, :zone_id, :integer- end-enddiff --git a/core/db/migrate/20130301162745_remove_shipping_category_id_from_shipping_method.rb b/core/db/migrate/20130301162745_remove_shipping_category_id_from_shipping_method.rbdeleted file mode 100644index abe12a22f8..0000000000--- a/core/db/migrate/20130301162745_remove_shipping_category_id_from_shipping_method.rb+++ /dev/null@@ -1,5 +0,0 @@-class RemoveShippingCategoryIdFromShippingMethod < ActiveRecord::Migration[4.2]- def change- remove_column :spree_shipping_methods, :shipping_category_id- end-enddiff --git a/core/db/migrate/20130301162924_create_shipping_method_categories.rb b/core/db/migrate/20130301162924_create_shipping_method_categories.rbdeleted file mode 100644index f97dbadfbf..0000000000--- a/core/db/migrate/20130301162924_create_shipping_method_categories.rb+++ /dev/null@@ -1,13 +0,0 @@-class CreateShippingMethodCategories < ActiveRecord::Migration[4.2]- def change- create_table :spree_shipping_method_categories do |t|- t.integer :shipping_method_id, null: false- t.integer :shipping_category_id, null: false-- t.timestamps null: false, precision: 6- end-- add_index :spree_shipping_method_categories, :shipping_method_id- add_index :spree_shipping_method_categories, :shipping_category_id- end-enddiff --git a/core/db/migrate/20130301205200_add_tracking_url_to_spree_shipping_methods.rb b/core/db/migrate/20130301205200_add_tracking_url_to_spree_shipping_methods.rbdeleted file mode 100644index d91c63c7b5..0000000000--- a/core/db/migrate/20130301205200_add_tracking_url_to_spree_shipping_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddTrackingUrlToSpreeShippingMethods < ActiveRecord::Migration[4.2]- def change- add_column :spree_shipping_methods, :tracking_url, :string- end-enddiff --git a/core/db/migrate/20130304162240_create_spree_shipping_rates.rb b/core/db/migrate/20130304162240_create_spree_shipping_rates.rbdeleted file mode 100644index a6f4fc490b..0000000000--- a/core/db/migrate/20130304162240_create_spree_shipping_rates.rb+++ /dev/null@@ -1,24 +0,0 @@-class CreateSpreeShippingRates < ActiveRecord::Migration[4.2]- def up- create_table :spree_shipping_rates do |t|- t.belongs_to :shipment- t.belongs_to :shipping_method- t.boolean :selected, default: false- t.decimal :cost, precision: 8, scale: 2- t.timestamps null: false, precision: 6- end- add_index(:spree_shipping_rates, [:shipment_id, :shipping_method_id],- name: 'spree_shipping_rates_join_index',- unique: true)-- # Spree::Shipment.all.each do |shipment|- # shipping_method = Spree::ShippingMethod.find(shipment.shipment_method_id)- # shipment.add_shipping_method(shipping_method, true)- # end- end-- def down- # add_column :spree_shipments, :shipping_method_id, :integer- drop_table :spree_shipping_rates- end-enddiff --git a/core/db/migrate/20130304192936_remove_category_match_attributes_from_shipping_method.rb b/core/db/migrate/20130304192936_remove_category_match_attributes_from_shipping_method.rbdeleted file mode 100644index 09217e00c4..0000000000--- a/core/db/migrate/20130304192936_remove_category_match_attributes_from_shipping_method.rb+++ /dev/null@@ -1,7 +0,0 @@-class RemoveCategoryMatchAttributesFromShippingMethod < ActiveRecord::Migration[4.2]- def change- remove_column :spree_shipping_methods, :match_none- remove_column :spree_shipping_methods, :match_one- remove_column :spree_shipping_methods, :match_all- end-enddiff --git a/core/db/migrate/20130305143310_create_stock_movements.rb b/core/db/migrate/20130305143310_create_stock_movements.rbdeleted file mode 100644index b25d0d33df..0000000000--- a/core/db/migrate/20130305143310_create_stock_movements.rb+++ /dev/null@@ -1,12 +0,0 @@-class CreateStockMovements < ActiveRecord::Migration[4.2]- def change- create_table :spree_stock_movements do |t|- t.belongs_to :stock_item- t.integer :quantity- t.string :action-- t.timestamps null: false, precision: 6- end- add_index :spree_stock_movements, :stock_item_id- end-enddiff --git a/core/db/migrate/20130306181701_add_address_fields_to_stock_location.rb b/core/db/migrate/20130306181701_add_address_fields_to_stock_location.rbdeleted file mode 100644index 68dbb09e5b..0000000000--- a/core/db/migrate/20130306181701_add_address_fields_to_stock_location.rb+++ /dev/null@@ -1,22 +0,0 @@-class AddAddressFieldsToStockLocation < ActiveRecord::Migration[4.2]- def change- remove_column :spree_stock_locations, :address_id-- add_column :spree_stock_locations, :address1, :string- add_column :spree_stock_locations, :address2, :string- add_column :spree_stock_locations, :city, :string- add_column :spree_stock_locations, :state_id, :integer- add_column :spree_stock_locations, :state_name, :string- add_column :spree_stock_locations, :country_id, :integer- add_column :spree_stock_locations, :zipcode, :string- add_column :spree_stock_locations, :phone, :string--- usa = Spree::Country.where(iso: 'US').first- # In case USA isn't found.- # See #3115- country = usa || Spree::Country.first- Spree::Country.reset_column_information- Spree::StockLocation.update_all(country_id: country)- end-enddiff --git a/core/db/migrate/20130306191917_add_active_field_to_stock_locations.rb b/core/db/migrate/20130306191917_add_active_field_to_stock_locations.rbdeleted file mode 100644index 0f36503843..0000000000--- a/core/db/migrate/20130306191917_add_active_field_to_stock_locations.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddActiveFieldToStockLocations < ActiveRecord::Migration[4.2]- def change- add_column :spree_stock_locations, :active, :boolean, default: true- end-enddiff --git a/core/db/migrate/20130306195650_add_backorderable_to_stock_item.rb b/core/db/migrate/20130306195650_add_backorderable_to_stock_item.rbdeleted file mode 100644index 71a96aa281..0000000000--- a/core/db/migrate/20130306195650_add_backorderable_to_stock_item.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddBackorderableToStockItem < ActiveRecord::Migration[4.2]- def change- add_column :spree_stock_items, :backorderable, :boolean, default: true- end-enddiff --git a/core/db/migrate/20130307161754_add_default_quantity_to_stock_movement.rb b/core/db/migrate/20130307161754_add_default_quantity_to_stock_movement.rbdeleted file mode 100644index 5a423e6d54..0000000000--- a/core/db/migrate/20130307161754_add_default_quantity_to_stock_movement.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddDefaultQuantityToStockMovement < ActiveRecord::Migration[4.2]- def change- change_column :spree_stock_movements, :quantity, :integer, default: 0- end-enddiff --git a/core/db/migrate/20130318151756_add_source_and_destination_to_stock_movements.rb b/core/db/migrate/20130318151756_add_source_and_destination_to_stock_movements.rbdeleted file mode 100644index f36569a10e..0000000000--- a/core/db/migrate/20130318151756_add_source_and_destination_to_stock_movements.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddSourceAndDestinationToStockMovements < ActiveRecord::Migration[4.2]- def change- change_table :spree_stock_movements do |t|- t.references :source, polymorphic: true- t.references :destination, polymorphic: true- end- end-enddiff --git a/core/db/migrate/20130319062004_change_orders_total_precision.rb b/core/db/migrate/20130319062004_change_orders_total_precision.rbdeleted file mode 100644index 4a60136af8..0000000000--- a/core/db/migrate/20130319062004_change_orders_total_precision.rb+++ /dev/null@@ -1,8 +0,0 @@-class ChangeOrdersTotalPrecision < ActiveRecord::Migration[4.2]- def change- change_column :spree_orders, :item_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- change_column :spree_orders, :total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- change_column :spree_orders, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- change_column :spree_orders, :payment_total, :decimal, precision: 10, scale: 2, default: 0.0- end-enddiff --git a/core/db/migrate/20130319063911_change_spree_payments_amount_precision.rb b/core/db/migrate/20130319063911_change_spree_payments_amount_precision.rbdeleted file mode 100644index 17c91e53d9..0000000000--- a/core/db/migrate/20130319063911_change_spree_payments_amount_precision.rb+++ /dev/null@@ -1,7 +0,0 @@-class ChangeSpreePaymentsAmountPrecision < ActiveRecord::Migration[4.2]- def change-- change_column :spree_payments, :amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false-- end-enddiff --git a/core/db/migrate/20130319064308_change_spree_return_authorization_amount_precision.rb b/core/db/migrate/20130319064308_change_spree_return_authorization_amount_precision.rbdeleted file mode 100644index 100043a265..0000000000--- a/core/db/migrate/20130319064308_change_spree_return_authorization_amount_precision.rb+++ /dev/null@@ -1,7 +0,0 @@-class ChangeSpreeReturnAuthorizationAmountPrecision < ActiveRecord::Migration[4.2]- def change-- change_column :spree_return_authorizations, :amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false-- end-enddiff --git a/core/db/migrate/20130319082943_change_adjustments_amount_precision.rb b/core/db/migrate/20130319082943_change_adjustments_amount_precision.rbdeleted file mode 100644index 2fd1723206..0000000000--- a/core/db/migrate/20130319082943_change_adjustments_amount_precision.rb+++ /dev/null@@ -1,7 +0,0 @@-class ChangeAdjustmentsAmountPrecision < ActiveRecord::Migration[4.2]- def change-- change_column :spree_adjustments, :amount, :decimal, precision: 10, scale: 2-- end-enddiff --git a/core/db/migrate/20130319183250_add_originator_to_stock_movement.rb b/core/db/migrate/20130319183250_add_originator_to_stock_movement.rbdeleted file mode 100644index 83f8973d3b..0000000000--- a/core/db/migrate/20130319183250_add_originator_to_stock_movement.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddOriginatorToStockMovement < ActiveRecord::Migration[4.2]- def change- change_table :spree_stock_movements do |t|- t.references :originator, polymorphic: true- end- end-enddiff --git a/core/db/migrate/20130319190507_drop_source_and_destination_from_stock_movement.rb b/core/db/migrate/20130319190507_drop_source_and_destination_from_stock_movement.rbdeleted file mode 100644index a2c181cb4d..0000000000--- a/core/db/migrate/20130319190507_drop_source_and_destination_from_stock_movement.rb+++ /dev/null@@ -1,15 +0,0 @@-class DropSourceAndDestinationFromStockMovement < ActiveRecord::Migration[4.2]- def up- change_table :spree_stock_movements do |t|- t.remove_references :source, polymorphic: true- t.remove_references :destination, polymorphic: true- end- end-- def down- change_table :spree_stock_movements do |t|- t.references :source, polymorphic: true- t.references :destination, polymorphic: true- end- end-enddiff --git a/core/db/migrate/20130325163316_migrate_inventory_unit_sold_to_on_hand.rb b/core/db/migrate/20130325163316_migrate_inventory_unit_sold_to_on_hand.rbdeleted file mode 100644index a4f2608441..0000000000--- a/core/db/migrate/20130325163316_migrate_inventory_unit_sold_to_on_hand.rb+++ /dev/null@@ -1,9 +0,0 @@-class MigrateInventoryUnitSoldToOnHand < ActiveRecord::Migration[4.2]- def up- Spree::InventoryUnit.where(state: 'sold').update_all(state: 'on_hand')- end-- def down- Spree::InventoryUnit.where(state: 'on_hand').update_all(state: 'sold')- end-enddiff --git a/core/db/migrate/20130326175857_add_stock_location_to_rma.rb b/core/db/migrate/20130326175857_add_stock_location_to_rma.rbdeleted file mode 100644index 442c161353..0000000000--- a/core/db/migrate/20130326175857_add_stock_location_to_rma.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddStockLocationToRMA < ActiveRecord::Migration[4.2]- def change- add_column :spree_return_authorizations, :stock_location_id, :integer- end-enddiff --git a/core/db/migrate/20130328130308_update_shipment_state_for_canceled_orders.rb b/core/db/migrate/20130328130308_update_shipment_state_for_canceled_orders.rbdeleted file mode 100644index ea5a2f4610..0000000000--- a/core/db/migrate/20130328130308_update_shipment_state_for_canceled_orders.rb+++ /dev/null@@ -1,15 +0,0 @@-class UpdateShipmentStateForCanceledOrders < ActiveRecord::Migration[4.2]- def up- shipments = Spree::Shipment.joins(:order).- where("spree_orders.state = 'canceled'")- case Spree::Shipment.connection.adapter_name- when "SQLite3"- shipments.update_all("state = 'cancelled'")- when "MySQL" || "PostgreSQL"- shipments.update_all("spree_shipments.state = 'cancelled'")- end- end-- def down- end-enddiff --git a/core/db/migrate/20130328195253_add_seo_metas_to_taxons.rb b/core/db/migrate/20130328195253_add_seo_metas_to_taxons.rbdeleted file mode 100644index 0cc3ed3841..0000000000--- a/core/db/migrate/20130328195253_add_seo_metas_to_taxons.rb+++ /dev/null@@ -1,9 +0,0 @@-class AddSeoMetasToTaxons < ActiveRecord::Migration[4.2]- def change- change_table :spree_taxons do |t|- t.string :meta_title- t.string :meta_description- t.string :meta_keywords- end- end-enddiff --git a/core/db/migrate/20130329134939_remove_stock_item_and_variant_lock.rb b/core/db/migrate/20130329134939_remove_stock_item_and_variant_lock.rbdeleted file mode 100644index 7b388fd819..0000000000--- a/core/db/migrate/20130329134939_remove_stock_item_and_variant_lock.rb+++ /dev/null@@ -1,14 +0,0 @@-class RemoveStockItemAndVariantLock < ActiveRecord::Migration[4.2]- def up- # we are moving to pessimistic locking on stock_items- remove_column :spree_stock_items, :lock_version-- # variants no longer manage their count_on_hand so we are removing their lock- remove_column :spree_variants, :lock_version- end-- def down- add_column :spree_stock_items, :lock_version, :integer- add_column :spree_variants, :lock_version, :integer- end-enddiff --git a/core/db/migrate/20130413230529_add_name_to_spree_credit_cards.rb b/core/db/migrate/20130413230529_add_name_to_spree_credit_cards.rbdeleted file mode 100644index 854e63baf5..0000000000--- a/core/db/migrate/20130413230529_add_name_to_spree_credit_cards.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddNameToSpreeCreditCards < ActiveRecord::Migration[4.2]- def change- add_column :spree_credit_cards, :name, :string- end-enddiff --git a/core/db/migrate/20130414000512_update_name_fields_on_spree_credit_cards.rb b/core/db/migrate/20130414000512_update_name_fields_on_spree_credit_cards.rbdeleted file mode 100644index d5ca3c69e3..0000000000--- a/core/db/migrate/20130414000512_update_name_fields_on_spree_credit_cards.rb+++ /dev/null@@ -1,13 +0,0 @@-class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration[4.2]- def up- if ApplicationRecord.connection.adapter_name.downcase.include? "mysql"- execute "UPDATE spree_credit_cards SET name = CONCAT(first_name, ' ', last_name)"- else- execute "UPDATE spree_credit_cards SET name = first_name || ' ' || last_name"- end- end-- def down- execute "UPDATE spree_credit_cards SET name = NULL"- end-enddiff --git a/core/db/migrate/20130417120034_add_index_to_source_columns_on_adjustments.rb b/core/db/migrate/20130417120034_add_index_to_source_columns_on_adjustments.rbdeleted file mode 100644index 608b7303b7..0000000000--- a/core/db/migrate/20130417120034_add_index_to_source_columns_on_adjustments.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexToSourceColumnsOnAdjustments < ActiveRecord::Migration[4.2]- def change- add_index :spree_adjustments, [:source_type, :source_id]- end-enddiff --git a/core/db/migrate/20130417120035_update_adjustment_states.rb b/core/db/migrate/20130417120035_update_adjustment_states.rbdeleted file mode 100644index 617726e6dc..0000000000--- a/core/db/migrate/20130417120035_update_adjustment_states.rb+++ /dev/null@@ -1,16 +0,0 @@-class UpdateAdjustmentStates < ActiveRecord::Migration[4.2]- def up- Spree::Order.complete.find_each do |order|- order.adjustments.update_all(state: 'closed')- end-- Spree::Shipment.shipped.includes(:adjustment).find_each do |shipment|- shipment.adjustment.update_column(:state, 'finalized') if shipment.adjustment- end-- Spree::Adjustment.where(state: nil).update_all(state: 'open')- end-- def down- end-enddiff --git a/core/db/migrate/20130417123427_add_shipping_rates_to_shipments.rb b/core/db/migrate/20130417123427_add_shipping_rates_to_shipments.rbdeleted file mode 100644index 4ada655df8..0000000000--- a/core/db/migrate/20130417123427_add_shipping_rates_to_shipments.rb+++ /dev/null@@ -1,15 +0,0 @@-class AddShippingRatesToShipments < ActiveRecord::Migration[4.2]- def up- Spree::Shipment.find_each do |shipment|- shipment.shipping_rates.create(shipping_method_id: shipment.shipping_method_id,- cost: shipment.cost,- selected: true)- end-- remove_column :spree_shipments, :shipping_method_id- end-- def down- add_column :spree_shipments, :shipping_method_id, :integer- end-enddiff --git a/core/db/migrate/20130418125341_create_spree_stock_transfers.rb b/core/db/migrate/20130418125341_create_spree_stock_transfers.rbdeleted file mode 100644index 801347678e..0000000000--- a/core/db/migrate/20130418125341_create_spree_stock_transfers.rb+++ /dev/null@@ -1,14 +0,0 @@-class CreateSpreeStockTransfers < ActiveRecord::Migration[4.2]- def change- create_table :spree_stock_transfers do |t|- t.string :type- t.string :reference_number- t.integer :source_location_id- t.integer :destination_location_id- t.timestamps null: false, precision: 6- end-- add_index :spree_stock_transfers, :source_location_id- add_index :spree_stock_transfers, :destination_location_id- end-enddiff --git a/core/db/migrate/20130423110707_drop_products_count_on_hand.rb b/core/db/migrate/20130423110707_drop_products_count_on_hand.rbdeleted file mode 100644index 692b6c58fd..0000000000--- a/core/db/migrate/20130423110707_drop_products_count_on_hand.rb+++ /dev/null@@ -1,5 +0,0 @@-class DropProductsCountOnHand < ActiveRecord::Migration[4.2]- def up- remove_column :spree_products, :count_on_hand- end-enddiff --git a/core/db/migrate/20130423223847_set_default_shipping_rate_cost.rb b/core/db/migrate/20130423223847_set_default_shipping_rate_cost.rbdeleted file mode 100644index faf88a92e5..0000000000--- a/core/db/migrate/20130423223847_set_default_shipping_rate_cost.rb+++ /dev/null@@ -1,5 +0,0 @@-class SetDefaultShippingRateCost < ActiveRecord::Migration[4.2]- def change- change_column :spree_shipping_rates, :cost, :decimal, default: 0, precision: 8, scale: 2- end-enddiff --git a/core/db/migrate/20130509115210_add_number_to_stock_transfer.rb b/core/db/migrate/20130509115210_add_number_to_stock_transfer.rbdeleted file mode 100644index 8373a3cf16..0000000000--- a/core/db/migrate/20130509115210_add_number_to_stock_transfer.rb+++ /dev/null@@ -1,23 +0,0 @@-class AddNumberToStockTransfer < ActiveRecord::Migration[4.2]- def up- remove_index :spree_stock_transfers, :source_location_id- remove_index :spree_stock_transfers, :destination_location_id-- rename_column :spree_stock_transfers, :reference_number, :reference- add_column :spree_stock_transfers, :number, :string-- Spree::StockTransfer.find_each do |transfer|- transfer.send(:generate_stock_transfer_number)- transfer.save!- end-- add_index :spree_stock_transfers, :number- add_index :spree_stock_transfers, :source_location_id- add_index :spree_stock_transfers, :destination_location_id- end-- def down- rename_column :spree_stock_transfers, :reference, :reference_number- remove_column :spree_stock_transfers, :number, :string- end-enddiff --git a/core/db/migrate/20130514151929_add_sku_index_to_spree_variants.rb b/core/db/migrate/20130514151929_add_sku_index_to_spree_variants.rbdeleted file mode 100644index 17d8871379..0000000000--- a/core/db/migrate/20130514151929_add_sku_index_to_spree_variants.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddSkuIndexToSpreeVariants < ActiveRecord::Migration[4.2]- def change- add_index :spree_variants, :sku- end-enddiff --git a/core/db/migrate/20130515180736_add_backorderable_default_to_spree_stock_location.rb b/core/db/migrate/20130515180736_add_backorderable_default_to_spree_stock_location.rbdeleted file mode 100644index 6c42c8cbcb..0000000000--- a/core/db/migrate/20130515180736_add_backorderable_default_to_spree_stock_location.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddBackorderableDefaultToSpreeStockLocation < ActiveRecord::Migration[4.2]- def change- add_column :spree_stock_locations, :backorderable_default, :boolean, default: true- end-enddiff --git a/core/db/migrate/20130516151222_add_propage_all_variants_to_spree_stock_location.rb b/core/db/migrate/20130516151222_add_propage_all_variants_to_spree_stock_location.rbdeleted file mode 100644index 72780bd830..0000000000--- a/core/db/migrate/20130516151222_add_propage_all_variants_to_spree_stock_location.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddPropageAllVariantsToSpreeStockLocation < ActiveRecord::Migration[4.2]- def change- add_column :spree_stock_locations, :propagate_all_variants, :boolean, default: true- end-enddiff --git a/core/db/migrate/20130611054351_rename_shipping_methods_zones_to_spree_shipping_methods_zones.rb b/core/db/migrate/20130611054351_rename_shipping_methods_zones_to_spree_shipping_methods_zones.rbdeleted file mode 100644index f1d405e416..0000000000--- a/core/db/migrate/20130611054351_rename_shipping_methods_zones_to_spree_shipping_methods_zones.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameShippingMethodsZonesToSpreeShippingMethodsZones < ActiveRecord::Migration[4.2]- def change- rename_table :shipping_methods_zones, :spree_shipping_methods_zones- end-enddiff --git a/core/db/migrate/20130611185927_add_user_id_index_to_spree_orders.rb b/core/db/migrate/20130611185927_add_user_id_index_to_spree_orders.rbdeleted file mode 100644index 46e760f04d..0000000000--- a/core/db/migrate/20130611185927_add_user_id_index_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddUserIdIndexToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_index :spree_orders, :user_id- end-enddiff --git a/core/db/migrate/20130618041418_add_updated_at_to_spree_countries.rb b/core/db/migrate/20130618041418_add_updated_at_to_spree_countries.rbdeleted file mode 100644index 5aab89dbc0..0000000000--- a/core/db/migrate/20130618041418_add_updated_at_to_spree_countries.rb+++ /dev/null@@ -1,9 +0,0 @@-class AddUpdatedAtToSpreeCountries < ActiveRecord::Migration[4.2]- def up- add_column :spree_countries, :updated_at, :datetime- end-- def down- remove_column :spree_countries, :updated_at- end-enddiff --git a/core/db/migrate/20130619012236_add_updated_at_to_spree_states.rb b/core/db/migrate/20130619012236_add_updated_at_to_spree_states.rbdeleted file mode 100644index b9e06fccee..0000000000--- a/core/db/migrate/20130619012236_add_updated_at_to_spree_states.rb+++ /dev/null@@ -1,9 +0,0 @@-class AddUpdatedAtToSpreeStates < ActiveRecord::Migration[4.2]- def up- add_column :spree_states, :updated_at, :datetime- end-- def down- remove_column :spree_states, :updated_at- end-enddiff --git a/core/db/migrate/20130626232741_add_cvv_result_code_and_cvv_result_message_to_spree_payments.rb b/core/db/migrate/20130626232741_add_cvv_result_code_and_cvv_result_message_to_spree_payments.rbdeleted file mode 100644index 1f2dbf8953..0000000000--- a/core/db/migrate/20130626232741_add_cvv_result_code_and_cvv_result_message_to_spree_payments.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddCvvResultCodeAndCvvResultMessageToSpreePayments < ActiveRecord::Migration[4.2]- def change- add_column :spree_payments, :cvv_response_code, :string- add_column :spree_payments, :cvv_response_message, :string- end-enddiff --git a/core/db/migrate/20130628021056_add_unique_index_to_permalink_on_spree_products.rb b/core/db/migrate/20130628021056_add_unique_index_to_permalink_on_spree_products.rbdeleted file mode 100644index 9c8e61865d..0000000000--- a/core/db/migrate/20130628021056_add_unique_index_to_permalink_on_spree_products.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddUniqueIndexToPermalinkOnSpreeProducts < ActiveRecord::Migration[4.2]- def change- add_index "spree_products", ["permalink"], name: "permalink_idx_unique", unique: true- end-enddiff --git a/core/db/migrate/20130628022817_add_unique_index_to_orders_shipments_and_stock_transfers.rb b/core/db/migrate/20130628022817_add_unique_index_to_orders_shipments_and_stock_transfers.rbdeleted file mode 100644index 7f89daadd3..0000000000--- a/core/db/migrate/20130628022817_add_unique_index_to_orders_shipments_and_stock_transfers.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddUniqueIndexToOrdersShipmentsAndStockTransfers < ActiveRecord::Migration[4.2]- def add- add_index "spree_orders", ["number"], name: "number_idx_unique", unique: true- add_index "spree_shipments", ["number"], name: "number_idx_unique", unique: true- add_index "spree_stock_transfers", ["number"], name: "number_idx_unique", unique: true- end-enddiff --git a/core/db/migrate/20130708052307_add_deleted_at_to_spree_tax_rates.rb b/core/db/migrate/20130708052307_add_deleted_at_to_spree_tax_rates.rbdeleted file mode 100644index 103517b2a7..0000000000--- a/core/db/migrate/20130708052307_add_deleted_at_to_spree_tax_rates.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddDeletedAtToSpreeTaxRates < ActiveRecord::Migration[4.2]- def change- add_column :spree_tax_rates, :deleted_at, :datetime- end-enddiff --git a/core/db/migrate/20130711200933_remove_lock_version_from_inventory_units.rb b/core/db/migrate/20130711200933_remove_lock_version_from_inventory_units.rbdeleted file mode 100644index b45b9ba78a..0000000000--- a/core/db/migrate/20130711200933_remove_lock_version_from_inventory_units.rb+++ /dev/null@@ -1,6 +0,0 @@-class RemoveLockVersionFromInventoryUnits < ActiveRecord::Migration[4.2]- def change- # we are moving to pessimistic locking on stock_items- remove_column :spree_inventory_units, :lock_version- end-enddiff --git a/core/db/migrate/20130718042445_add_cost_price_to_line_item.rb b/core/db/migrate/20130718042445_add_cost_price_to_line_item.rbdeleted file mode 100644index 9f76816313..0000000000--- a/core/db/migrate/20130718042445_add_cost_price_to_line_item.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCostPriceToLineItem < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :cost_price, :decimal, precision: 8, scale: 2- end-enddiff --git a/core/db/migrate/20130718233855_set_backorderable_to_default_to_false.rb b/core/db/migrate/20130718233855_set_backorderable_to_default_to_false.rbdeleted file mode 100644index 08ff1ba31a..0000000000--- a/core/db/migrate/20130718233855_set_backorderable_to_default_to_false.rb+++ /dev/null@@ -1,6 +0,0 @@-class SetBackorderableToDefaultToFalse < ActiveRecord::Migration[4.2]- def change- change_column :spree_stock_items, :backorderable, :boolean, default: false- change_column :spree_stock_locations, :backorderable_default, :boolean, default: false- end-enddiff --git a/core/db/migrate/20130725031716_add_created_by_id_to_spree_orders.rb b/core/db/migrate/20130725031716_add_created_by_id_to_spree_orders.rbdeleted file mode 100644index cea613e943..0000000000--- a/core/db/migrate/20130725031716_add_created_by_id_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCreatedByIdToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :created_by_id, :integer- end-enddiff --git a/core/db/migrate/20130729214043_index_completed_at_on_spree_orders.rb b/core/db/migrate/20130729214043_index_completed_at_on_spree_orders.rbdeleted file mode 100644index 24e06b6235..0000000000--- a/core/db/migrate/20130729214043_index_completed_at_on_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class IndexCompletedAtOnSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_index :spree_orders, :completed_at- end-enddiff --git a/core/db/migrate/20130802014537_add_tax_category_id_to_spree_line_items.rb b/core/db/migrate/20130802014537_add_tax_category_id_to_spree_line_items.rbdeleted file mode 100644index bffa364245..0000000000--- a/core/db/migrate/20130802014537_add_tax_category_id_to_spree_line_items.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddTaxCategoryIdToSpreeLineItems < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :tax_category_id, :integer- end-enddiff --git a/core/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb b/core/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rbdeleted file mode 100644index d3d3fe6834..0000000000--- a/core/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb+++ /dev/null@@ -1,10 +0,0 @@-class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration[4.2]- def change- Spree::LineItem.find_each do |line_item|- next if line_item.variant.nil?- next if line_item.variant.product.nil?- next if line_item.product.nil?- line_item.update_column(:tax_category_id, line_item.product.tax_category_id)- end- end-enddiff --git a/core/db/migrate/20130806022521_drop_spree_mail_methods.rb b/core/db/migrate/20130806022521_drop_spree_mail_methods.rbdeleted file mode 100644index f54d6af23c..0000000000--- a/core/db/migrate/20130806022521_drop_spree_mail_methods.rb+++ /dev/null@@ -1,12 +0,0 @@-class DropSpreeMailMethods < ActiveRecord::Migration[4.2]- def up- drop_table :spree_mail_methods- end-- def down- create_table(:spree_mail_methods) do |t|- t.string :environment- t.boolean :active- end- end-enddiff --git a/core/db/migrate/20130806145853_set_default_stock_location_on_shipments.rb b/core/db/migrate/20130806145853_set_default_stock_location_on_shipments.rbdeleted file mode 100644index cb421593ce..0000000000--- a/core/db/migrate/20130806145853_set_default_stock_location_on_shipments.rb+++ /dev/null@@ -1,8 +0,0 @@-class SetDefaultStockLocationOnShipments < ActiveRecord::Migration[4.2]- def change- if Spree::Shipment.where('stock_location_id IS NULL').count > 0- location = Spree::StockLocation.find_by(name: 'default') || Spree::StockLocation.first- Spree::Shipment.where('stock_location_id IS NULL').update_all(stock_location_id: location.id)- end- end-enddiff --git a/core/db/migrate/20130807024301_upgrade_adjustments.rb b/core/db/migrate/20130807024301_upgrade_adjustments.rbdeleted file mode 100644index ee9dbd2f6c..0000000000--- a/core/db/migrate/20130807024301_upgrade_adjustments.rb+++ /dev/null@@ -1,46 +0,0 @@-class UpgradeAdjustments < ActiveRecord::Migration[4.2]- def up- # Add Temporary index- add_index :spree_adjustments, :originator_type unless index_exists?(:spree_adjustments, :originator_type)-- # Temporarily make originator association available- Spree::Adjustment.class_eval do- belongs_to :originator, polymorphic: true- end- # Shipping adjustments are now tracked as fields on the object- Spree::Adjustment.where(source_type: "Spree::Shipment").find_each do |adjustment|- # Account for possible invalid data- next if adjustment.source.nil?- adjustment.source.update_column(:cost, adjustment.amount)- adjustment.destroy!- end-- # Tax adjustments have their sources altered- Spree::Adjustment.where(originator_type: "Spree::TaxRate").find_each do |adjustment|- adjustment.source_id = adjustment.originator_id- adjustment.source_type = "Spree::TaxRate"- adjustment.save!- end-- # Promotion adjustments have their source altered also- Spree::Adjustment.where(originator_type: "Spree::PromotionAction").find_each do |adjustment|- next if adjustment.originator.nil?- adjustment.source = adjustment.originator- begin- if adjustment.source.calculator_type == "Spree::Calculator::FreeShipping"- # Previously this was a Spree::Promotion::Actions::CreateAdjustment- # And it had a calculator to work out FreeShipping- # In Spree 2.2, the "calculator" is now the action itself.- adjustment.source.becomes(Spree::Promotion::Actions::FreeShipping)- end- rescue- # Fail silently. This is primarily in instances where the calculator no longer exists- end-- adjustment.save!- end-- # Remove Temporary index- remove_index :spree_adjustments, :originator_type if index_exists?(:spree_adjustments, :originator_type)- end-enddiff --git a/core/db/migrate/20130807024302_rename_adjustment_fields.rb b/core/db/migrate/20130807024302_rename_adjustment_fields.rbdeleted file mode 100644index f6b362b347..0000000000--- a/core/db/migrate/20130807024302_rename_adjustment_fields.rb+++ /dev/null@@ -1,20 +0,0 @@-class RenameAdjustmentFields < ActiveRecord::Migration[4.2]- def up- # Add Temporary index- add_index :spree_adjustments, :adjustable_type unless index_exists?(:spree_adjustments, :adjustable_type)-- remove_column :spree_adjustments, :originator_id- remove_column :spree_adjustments, :originator_type-- add_column :spree_adjustments, :order_id, :integer unless column_exists?(:spree_adjustments, :order_id)-- # This enables the Spree::Order#all_adjustments association to work correctly- Spree::Adjustment.reset_column_information- Spree::Adjustment.where(adjustable_type: "Spree::Order").find_each do |adjustment|- adjustment.update_column(:order_id, adjustment.adjustable_id)- end-- # Remove Temporary index- remove_index :spree_adjustments, :adjustable_type if index_exists?(:spree_adjustments, :adjustable_type)- end-enddiff --git a/core/db/migrate/20130809164245_add_admin_name_column_to_spree_shipping_methods.rb b/core/db/migrate/20130809164245_add_admin_name_column_to_spree_shipping_methods.rbdeleted file mode 100644index af7655cdc9..0000000000--- a/core/db/migrate/20130809164245_add_admin_name_column_to_spree_shipping_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddAdminNameColumnToSpreeShippingMethods < ActiveRecord::Migration[4.2]- def change- add_column :spree_shipping_methods, :admin_name, :string- end-enddiff --git a/core/db/migrate/20130809164330_add_admin_name_column_to_spree_stock_locations.rb b/core/db/migrate/20130809164330_add_admin_name_column_to_spree_stock_locations.rbdeleted file mode 100644index 39b8b17a76..0000000000--- a/core/db/migrate/20130809164330_add_admin_name_column_to_spree_stock_locations.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddAdminNameColumnToSpreeStockLocations < ActiveRecord::Migration[4.2]- def change- add_column :spree_stock_locations, :admin_name, :string- end-enddiff --git a/core/db/migrate/20130813004002_add_shipment_total_to_spree_orders.rb b/core/db/migrate/20130813004002_add_shipment_total_to_spree_orders.rbdeleted file mode 100644index 0722caba0d..0000000000--- a/core/db/migrate/20130813004002_add_shipment_total_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddShipmentTotalToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :shipment_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- end-enddiff --git a/core/db/migrate/20130813140619_expand_order_number_size.rb b/core/db/migrate/20130813140619_expand_order_number_size.rbdeleted file mode 100644index 347e1f5e3e..0000000000--- a/core/db/migrate/20130813140619_expand_order_number_size.rb+++ /dev/null@@ -1,9 +0,0 @@-class ExpandOrderNumberSize < ActiveRecord::Migration[4.2]- def up- change_column :spree_orders, :number, :string, limit: 32- end-- def down- change_column :spree_orders, :number, :string, limit: 15- end-enddiff --git a/core/db/migrate/20130813232134_rename_activators_to_promotions.rb b/core/db/migrate/20130813232134_rename_activators_to_promotions.rbdeleted file mode 100644index fedd42715b..0000000000--- a/core/db/migrate/20130813232134_rename_activators_to_promotions.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameActivatorsToPromotions < ActiveRecord::Migration[4.2]- def change- rename_table :spree_activators, :spree_promotions- end-enddiff --git a/core/db/migrate/20130815000406_add_adjustment_total_to_line_items.rb b/core/db/migrate/20130815000406_add_adjustment_total_to_line_items.rbdeleted file mode 100644index 6a91e39bd2..0000000000--- a/core/db/migrate/20130815000406_add_adjustment_total_to_line_items.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddAdjustmentTotalToLineItems < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0- end-enddiff --git a/core/db/migrate/20130815024413_add_adjustment_total_to_shipments.rb b/core/db/migrate/20130815024413_add_adjustment_total_to_shipments.rbdeleted file mode 100644index 26a0b6b275..0000000000--- a/core/db/migrate/20130815024413_add_adjustment_total_to_shipments.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddAdjustmentTotalToShipments < ActiveRecord::Migration[4.2]- def change- add_column :spree_shipments, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0- end-enddiff --git a/core/db/migrate/20130826062534_add_depth_to_spree_taxons.rb b/core/db/migrate/20130826062534_add_depth_to_spree_taxons.rbdeleted file mode 100644index 4cbc4399d2..0000000000--- a/core/db/migrate/20130826062534_add_depth_to_spree_taxons.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddDepthToSpreeTaxons < ActiveRecord::Migration[4.2]- def up- if !Spree::Taxon.column_names.include?('depth')- add_column :spree_taxons, :depth, :integer-- say_with_time 'Update depth on all taxons' do- Spree::Taxon.reset_column_information- Spree::Taxon.all.each { |t| t.save }- end- end- end-- def down- remove_column :spree_taxons, :depth- end-enddiff --git a/core/db/migrate/20130828234942_add_tax_total_to_line_items_shipments_and_orders.rb b/core/db/migrate/20130828234942_add_tax_total_to_line_items_shipments_and_orders.rbdeleted file mode 100644index 61ba63c5bb..0000000000--- a/core/db/migrate/20130828234942_add_tax_total_to_line_items_shipments_and_orders.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddTaxTotalToLineItemsShipmentsAndOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0- add_column :spree_shipments, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0- # This column may already be here from a 2.1.x migration- add_column :spree_orders, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 unless column_exists? :spree_orders, :tax_total, :decimal- end-enddiff --git a/core/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rb b/core/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rbdeleted file mode 100644index e3047872c4..0000000000--- a/core/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rb+++ /dev/null@@ -1,15 +0,0 @@-class AddShippingCategoryToShippingMethodsAndProducts < ActiveRecord::Migration[4.2]- def up- default_category = Spree::ShippingCategory.first- default_category ||= Spree::ShippingCategory.create!(name: "Default")-- Spree::ShippingMethod.all.each do |method|- method.shipping_categories << default_category if method.shipping_categories.blank?- end-- Spree::Product.where(shipping_category_id: nil).update_all(shipping_category_id: default_category.id)- end-- def down- end-enddiff --git a/core/db/migrate/20130830001159_migrate_old_shipping_calculators.rb b/core/db/migrate/20130830001159_migrate_old_shipping_calculators.rbdeleted file mode 100644index 78475beb41..0000000000--- a/core/db/migrate/20130830001159_migrate_old_shipping_calculators.rb+++ /dev/null@@ -1,19 +0,0 @@-class MigrateOldShippingCalculators < ActiveRecord::Migration[4.2]- def up- Spree::ShippingMethod.all.each do |shipping_method|- old_calculator = shipping_method.calculator- next if old_calculator.class < Spree::ShippingCalculator # We don't want to mess with new shipping calculators- new_calculator = eval(old_calculator.class.name.sub("::Calculator::", "::Calculator::Shipping::")).new- new_calculator.preferences.keys.each do |pref|- # Preferences can't be read/set by name, you have to prefix preferred_- pref_method = "preferred_#{pref}"- new_calculator.send("#{pref_method}=", old_calculator.send(pref_method))- end- new_calculator.calculable = old_calculator.calculable- new_calculator.save- end- end-- def down- end-enddiff --git a/core/db/migrate/20130903183026_add_code_to_spree_promotion_rules.rb b/core/db/migrate/20130903183026_add_code_to_spree_promotion_rules.rbdeleted file mode 100644index 8aa9c2351c..0000000000--- a/core/db/migrate/20130903183026_add_code_to_spree_promotion_rules.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCodeToSpreePromotionRules < ActiveRecord::Migration[4.2]- def change- add_column :spree_promotion_rules, :code, :string- end-enddiff --git a/core/db/migrate/20130909115621_change_states_required_for_countries.rb b/core/db/migrate/20130909115621_change_states_required_for_countries.rbdeleted file mode 100644index 9870355469..0000000000--- a/core/db/migrate/20130909115621_change_states_required_for_countries.rb+++ /dev/null@@ -1,9 +0,0 @@-class ChangeStatesRequiredForCountries < ActiveRecord::Migration[4.2]- def up- change_column_default :spree_countries, :states_required, false- end-- def down- change_column_default :spree_countries, :states_required, true- end-enddiff --git a/core/db/migrate/20130915032339_add_deleted_at_to_spree_stock_items.rb b/core/db/migrate/20130915032339_add_deleted_at_to_spree_stock_items.rbdeleted file mode 100644index eca5b4c637..0000000000--- a/core/db/migrate/20130915032339_add_deleted_at_to_spree_stock_items.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddDeletedAtToSpreeStockItems < ActiveRecord::Migration[4.2]- def change- add_column :spree_stock_items, :deleted_at, :datetime- end-enddiff --git a/core/db/migrate/20130917024658_remove_promotions_event_name_field.rb b/core/db/migrate/20130917024658_remove_promotions_event_name_field.rbdeleted file mode 100644index 095ac72dcd..0000000000--- a/core/db/migrate/20130917024658_remove_promotions_event_name_field.rb+++ /dev/null@@ -1,5 +0,0 @@-class RemovePromotionsEventNameField < ActiveRecord::Migration[4.2]- def change- remove_column :spree_promotions, :event_name, :string- end-enddiff --git a/core/db/migrate/20130924040529_add_promo_total_to_line_items_and_shipments_and_orders.rb b/core/db/migrate/20130924040529_add_promo_total_to_line_items_and_shipments_and_orders.rbdeleted file mode 100644index f7f34d0716..0000000000--- a/core/db/migrate/20130924040529_add_promo_total_to_line_items_and_shipments_and_orders.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddPromoTotalToLineItemsAndShipmentsAndOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0- add_column :spree_shipments, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0- add_column :spree_orders, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0- end-enddiff --git a/core/db/migrate/20131001013410_remove_unused_credit_card_fields.rb b/core/db/migrate/20131001013410_remove_unused_credit_card_fields.rbdeleted file mode 100644index 1c2403d54b..0000000000--- a/core/db/migrate/20131001013410_remove_unused_credit_card_fields.rb+++ /dev/null@@ -1,16 +0,0 @@-class RemoveUnusedCreditCardFields < ActiveRecord::Migration[4.2]- def up- remove_column :spree_credit_cards, :start_month if column_exists?(:spree_credit_cards, :start_month)- remove_column :spree_credit_cards, :start_year if column_exists?(:spree_credit_cards, :start_year)- remove_column :spree_credit_cards, :issue_number if column_exists?(:spree_credit_cards, :issue_number)- end- def down- add_column :spree_credit_cards, :start_month, :string- add_column :spree_credit_cards, :start_year, :string- add_column :spree_credit_cards, :issue_number, :string- end-- def column_exists?(table, column)- ApplicationRecord.connection.column_exists?(table, column)- end-enddiff --git a/core/db/migrate/20131026154747_add_track_inventory_to_variant.rb b/core/db/migrate/20131026154747_add_track_inventory_to_variant.rbdeleted file mode 100644index 58f46b8152..0000000000--- a/core/db/migrate/20131026154747_add_track_inventory_to_variant.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddTrackInventoryToVariant < ActiveRecord::Migration[4.2]- def change- add_column :spree_variants, :track_inventory, :boolean, default: true- end-enddiff --git a/core/db/migrate/20131107132123_add_tax_category_to_variants.rb b/core/db/migrate/20131107132123_add_tax_category_to_variants.rbdeleted file mode 100644index c7793146a5..0000000000--- a/core/db/migrate/20131107132123_add_tax_category_to_variants.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddTaxCategoryToVariants < ActiveRecord::Migration[4.2]- def change- add_column :spree_variants, :tax_category_id, :integer- add_index :spree_variants, :tax_category_id- end-enddiff --git a/core/db/migrate/20131113035136_add_channel_to_spree_orders.rb b/core/db/migrate/20131113035136_add_channel_to_spree_orders.rbdeleted file mode 100644index 86d2a023c6..0000000000--- a/core/db/migrate/20131113035136_add_channel_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddChannelToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :channel, :string, default: "spree"- end-enddiff --git a/core/db/migrate/20131118043959_add_included_to_adjustments.rb b/core/db/migrate/20131118043959_add_included_to_adjustments.rbdeleted file mode 100644index c562c94ad4..0000000000--- a/core/db/migrate/20131118043959_add_included_to_adjustments.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIncludedToAdjustments < ActiveRecord::Migration[4.2]- def change- add_column :spree_adjustments, :included, :boolean, default: false unless Spree::Adjustment.column_names.include?("included")- end-enddiff --git a/core/db/migrate/20131118050234_rename_tax_total_fields.rb b/core/db/migrate/20131118050234_rename_tax_total_fields.rbdeleted file mode 100644index 23239bec2e..0000000000--- a/core/db/migrate/20131118050234_rename_tax_total_fields.rb+++ /dev/null@@ -1,11 +0,0 @@-class RenameTaxTotalFields < ActiveRecord::Migration[4.2]- def change- rename_column :spree_line_items, :tax_total, :additional_tax_total- rename_column :spree_shipments, :tax_total, :additional_tax_total- rename_column :spree_orders, :tax_total, :additional_tax_total-- add_column :spree_line_items, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0- add_column :spree_shipments, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0- add_column :spree_orders, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0- end-enddiff --git a/core/db/migrate/20131118183431_add_line_item_id_to_spree_inventory_units.rb b/core/db/migrate/20131118183431_add_line_item_id_to_spree_inventory_units.rbdeleted file mode 100644index 8380cf197b..0000000000--- a/core/db/migrate/20131118183431_add_line_item_id_to_spree_inventory_units.rb+++ /dev/null@@ -1,21 +0,0 @@-class AddLineItemIdToSpreeInventoryUnits < ActiveRecord::Migration[4.2]- def change- # Stores running the product-assembly extension already have a line_item_id column- unless column_exists? Spree::InventoryUnit.table_name, :line_item_id- add_column :spree_inventory_units, :line_item_id, :integer- add_index :spree_inventory_units, :line_item_id-- shipments = Spree::Shipment.includes(:inventory_units, :order)-- shipments.find_each do |shipment|- shipment.inventory_units.group_by(&:variant_id).each do |variant_id, units|-- line_item = shipment.order.line_items.find_by(variant_id: variant_id)- next unless line_item-- Spree::InventoryUnit.where(id: units.map(&:id)).update_all(line_item_id: line_item.id)- end- end- end- end-enddiff --git a/core/db/migrate/20131120234456_add_updated_at_to_variants.rb b/core/db/migrate/20131120234456_add_updated_at_to_variants.rbdeleted file mode 100644index 409c5a1db2..0000000000--- a/core/db/migrate/20131120234456_add_updated_at_to_variants.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddUpdatedAtToVariants < ActiveRecord::Migration[4.2]- def change- add_column :spree_variants, :updated_at, :datetime- end-enddiff --git a/core/db/migrate/20131127001002_add_position_to_classifications.rb b/core/db/migrate/20131127001002_add_position_to_classifications.rbdeleted file mode 100644index 15e46057e2..0000000000--- a/core/db/migrate/20131127001002_add_position_to_classifications.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddPositionToClassifications < ActiveRecord::Migration[4.2]- def change- add_column :spree_products_taxons, :position, :integer- end-enddiff --git a/core/db/migrate/20131211112807_create_spree_orders_promotions.rb b/core/db/migrate/20131211112807_create_spree_orders_promotions.rbdeleted file mode 100644index 1e013cd48d..0000000000--- a/core/db/migrate/20131211112807_create_spree_orders_promotions.rb+++ /dev/null@@ -1,8 +0,0 @@-class CreateSpreeOrdersPromotions < ActiveRecord::Migration[4.2]- def change- create_table :spree_orders_promotions, id: false do |t|- t.references :order- t.references :promotion- end- end-enddiff --git a/core/db/migrate/20131211192741_unique_shipping_method_categories.rb b/core/db/migrate/20131211192741_unique_shipping_method_categories.rbdeleted file mode 100644index 13da4c8989..0000000000--- a/core/db/migrate/20131211192741_unique_shipping_method_categories.rb+++ /dev/null@@ -1,24 +0,0 @@-class UniqueShippingMethodCategories < ActiveRecord::Migration[4.2]- def change- klass = Spree::ShippingMethodCategory- columns = %w[shipping_category_id shipping_method_id]-- say "Find duplicate #{klass} records"- duplicates = klass.- select((columns + %w[COUNT(*)]).join(',')).- group(columns.join(',')).- having('COUNT(*) > 1').- map { |row| row.attributes.slice(*columns) }-- say "Delete all but the oldest duplicate #{klass} record"- duplicates.each do |conditions|- klass.where(conditions).order(:created_at).drop(1).each(&:destroy)- end-- say "Add unique index to #{klass.table_name} for #{columns.inspect}"- add_index klass.table_name, columns, unique: true, name: 'unique_spree_shipping_method_categories'-- say "Remove redundant simple index on #{klass.table_name}"- remove_index klass.table_name, name: 'index_spree_shipping_method_categories_on_shipping_category_id'- end-enddiff --git a/core/db/migrate/20131218054603_add_item_count_to_spree_orders.rb b/core/db/migrate/20131218054603_add_item_count_to_spree_orders.rbdeleted file mode 100644index 6ee215c564..0000000000--- a/core/db/migrate/20131218054603_add_item_count_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddItemCountToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :item_count, :integer, default: 0- end-enddiff --git a/core/db/migrate/20140106065820_remove_value_type_from_spree_preferences.rb b/core/db/migrate/20140106065820_remove_value_type_from_spree_preferences.rbdeleted file mode 100644index 2a8678e3ae..0000000000--- a/core/db/migrate/20140106065820_remove_value_type_from_spree_preferences.rb+++ /dev/null@@ -1,8 +0,0 @@-class RemoveValueTypeFromSpreePreferences < ActiveRecord::Migration[4.2]- def up- remove_column :spree_preferences, :value_type- end- def down- raise ActiveRecord::IrreversableMigration- end-enddiff --git a/core/db/migrate/20140106224208_rename_permalink_to_slug_for_products.rb b/core/db/migrate/20140106224208_rename_permalink_to_slug_for_products.rbdeleted file mode 100644index e71b093c0d..0000000000--- a/core/db/migrate/20140106224208_rename_permalink_to_slug_for_products.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenamePermalinkToSlugForProducts < ActiveRecord::Migration[4.2]- def change- rename_column :spree_products, :permalink, :slug- end-enddiff --git a/core/db/migrate/20140120160805_add_index_to_variant_id_and_currency_on_prices.rb b/core/db/migrate/20140120160805_add_index_to_variant_id_and_currency_on_prices.rbdeleted file mode 100644index c1d8143968..0000000000--- a/core/db/migrate/20140120160805_add_index_to_variant_id_and_currency_on_prices.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexToVariantIdAndCurrencyOnPrices < ActiveRecord::Migration[4.2]- def change- add_index :spree_prices, [:variant_id, :currency]- end-enddiff --git a/core/db/migrate/20140124023232_rename_activator_id_in_rules_and_actions_to_promotion_id.rb b/core/db/migrate/20140124023232_rename_activator_id_in_rules_and_actions_to_promotion_id.rbdeleted file mode 100644index c69c0f5d0c..0000000000--- a/core/db/migrate/20140124023232_rename_activator_id_in_rules_and_actions_to_promotion_id.rb+++ /dev/null@@ -1,6 +0,0 @@-class RenameActivatorIdInRulesAndActionsToPromotionId < ActiveRecord::Migration[4.2]- def change- rename_column :spree_promotion_rules, :activator_id, :promotion_id- rename_column :spree_promotion_actions, :activator_id, :promotion_id- end-enddiff --git a/core/db/migrate/20140129024326_add_deleted_at_to_spree_prices.rb b/core/db/migrate/20140129024326_add_deleted_at_to_spree_prices.rbdeleted file mode 100644index c1159f8e5a..0000000000--- a/core/db/migrate/20140129024326_add_deleted_at_to_spree_prices.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddDeletedAtToSpreePrices < ActiveRecord::Migration[4.2]- def change- add_column :spree_prices, :deleted_at, :datetime- end-enddiff --git a/core/db/migrate/20140203161722_add_approver_id_and_approved_at_to_orders.rb b/core/db/migrate/20140203161722_add_approver_id_and_approved_at_to_orders.rbdeleted file mode 100644index 81b3570a70..0000000000--- a/core/db/migrate/20140203161722_add_approver_id_and_approved_at_to_orders.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddApproverIdAndApprovedAtToOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :approver_id, :integer- add_column :spree_orders, :approved_at, :datetime- end-enddiff --git a/core/db/migrate/20140204115338_add_confirmation_delivered_to_spree_orders.rb b/core/db/migrate/20140204115338_add_confirmation_delivered_to_spree_orders.rbdeleted file mode 100644index 50d82f14f3..0000000000--- a/core/db/migrate/20140204115338_add_confirmation_delivered_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddConfirmationDeliveredToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :confirmation_delivered, :boolean, default: false- end-enddiff --git a/core/db/migrate/20140204192230_add_auto_capture_to_payment_methods.rb b/core/db/migrate/20140204192230_add_auto_capture_to_payment_methods.rbdeleted file mode 100644index f531a8ac5f..0000000000--- a/core/db/migrate/20140204192230_add_auto_capture_to_payment_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddAutoCaptureToPaymentMethods < ActiveRecord::Migration[4.2]- def change- add_column :spree_payment_methods, :auto_capture, :boolean- end-enddiff --git a/core/db/migrate/20140205120320_create_spree_payment_capture_events.rb b/core/db/migrate/20140205120320_create_spree_payment_capture_events.rbdeleted file mode 100644index 9107981526..0000000000--- a/core/db/migrate/20140205120320_create_spree_payment_capture_events.rb+++ /dev/null@@ -1,12 +0,0 @@-class CreateSpreePaymentCaptureEvents < ActiveRecord::Migration[4.2]- def change- create_table :spree_payment_capture_events do |t|- t.decimal :amount, precision: 10, scale: 2, default: 0.0- t.integer :payment_id-- t.timestamps null: false, precision: 6- end-- add_index :spree_payment_capture_events, :payment_id- end-enddiff --git a/core/db/migrate/20140205144710_add_uncaptured_amount_to_payments.rb b/core/db/migrate/20140205144710_add_uncaptured_amount_to_payments.rbdeleted file mode 100644index 2856f3af60..0000000000--- a/core/db/migrate/20140205144710_add_uncaptured_amount_to_payments.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddUncapturedAmountToPayments < ActiveRecord::Migration[4.2]- def change- add_column :spree_payments, :uncaptured_amount, :decimal, precision: 10, scale: 2, default: 0.0- end-enddiff --git a/core/db/migrate/20140205181631_default_variant_weight_to_zero.rb b/core/db/migrate/20140205181631_default_variant_weight_to_zero.rbdeleted file mode 100644index 3041cf1b18..0000000000--- a/core/db/migrate/20140205181631_default_variant_weight_to_zero.rb+++ /dev/null@@ -1,11 +0,0 @@-class DefaultVariantWeightToZero < ActiveRecord::Migration[4.2]- def up- Spree::Variant.unscoped.where(weight: nil).update_all("weight = 0.0")-- change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2, default: 0.0- end-- def down- change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2- end-enddiff --git a/core/db/migrate/20140207085910_add_tax_category_id_to_shipping_methods.rb b/core/db/migrate/20140207085910_add_tax_category_id_to_shipping_methods.rbdeleted file mode 100644index cf2db90754..0000000000--- a/core/db/migrate/20140207085910_add_tax_category_id_to_shipping_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddTaxCategoryIdToShippingMethods < ActiveRecord::Migration[4.2]- def change- add_column :spree_shipping_methods, :tax_category_id, :integer- end-enddiff --git a/core/db/migrate/20140207093021_add_tax_rate_id_to_shipping_rates.rb b/core/db/migrate/20140207093021_add_tax_rate_id_to_shipping_rates.rbdeleted file mode 100644index f148ec8288..0000000000--- a/core/db/migrate/20140207093021_add_tax_rate_id_to_shipping_rates.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddTaxRateIdToShippingRates < ActiveRecord::Migration[4.2]- def change- add_column :spree_shipping_rates, :tax_rate_id, :integer- end-enddiff --git a/core/db/migrate/20140211040159_add_pre_tax_amount_to_line_items_and_shipments.rb b/core/db/migrate/20140211040159_add_pre_tax_amount_to_line_items_and_shipments.rbdeleted file mode 100644index 586aef8459..0000000000--- a/core/db/migrate/20140211040159_add_pre_tax_amount_to_line_items_and_shipments.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddPreTaxAmountToLineItemsAndShipments < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :pre_tax_amount, :decimal, precision: 8, scale: 2- add_column :spree_shipments, :pre_tax_amount, :decimal, precision: 8, scale: 2- end-enddiff --git a/core/db/migrate/20140213184916_add_more_indexes.rb b/core/db/migrate/20140213184916_add_more_indexes.rbdeleted file mode 100644index 15381ee3b4..0000000000--- a/core/db/migrate/20140213184916_add_more_indexes.rb+++ /dev/null@@ -1,13 +0,0 @@-class AddMoreIndexes < ActiveRecord::Migration[4.2]- def change- add_index :spree_payment_methods, [:id, :type]- add_index :spree_calculators, [:id, :type]- add_index :spree_calculators, [:calculable_id, :calculable_type]- add_index :spree_payments, :payment_method_id- add_index :spree_promotion_actions, [:id, :type]- add_index :spree_promotion_actions, :promotion_id- add_index :spree_promotions, [:id, :type]- add_index :spree_option_values, :option_type_id- add_index :spree_shipments, :stock_location_id- end-enddiff --git a/core/db/migrate/20140219060952_add_considered_risky_to_orders.rb b/core/db/migrate/20140219060952_add_considered_risky_to_orders.rbdeleted file mode 100644index 5a3eb04a9b..0000000000--- a/core/db/migrate/20140219060952_add_considered_risky_to_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddConsideredRiskyToOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :considered_risky, :boolean, default: false- end-enddiff --git a/core/db/migrate/20140227112348_add_preference_store_to_everything.rb b/core/db/migrate/20140227112348_add_preference_store_to_everything.rbdeleted file mode 100644index 7966807765..0000000000--- a/core/db/migrate/20140227112348_add_preference_store_to_everything.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddPreferenceStoreToEverything < ActiveRecord::Migration[4.2]- def change- add_column :spree_calculators, :preferences, :text- add_column :spree_gateways, :preferences, :text- add_column :spree_payment_methods, :preferences, :text- add_column :spree_promotion_rules, :preferences, :text- end-enddiff --git a/core/db/migrate/20140307235515_add_user_id_to_spree_credit_cards.rb b/core/db/migrate/20140307235515_add_user_id_to_spree_credit_cards.rbdeleted file mode 100644index 904b872590..0000000000--- a/core/db/migrate/20140307235515_add_user_id_to_spree_credit_cards.rb+++ /dev/null@@ -1,13 +0,0 @@-class AddUserIdToSpreeCreditCards < ActiveRecord::Migration[4.2]- def change- unless Spree::CreditCard.column_names.include? "user_id"- add_column :spree_credit_cards, :user_id, :integer- add_index :spree_credit_cards, :user_id- end-- unless Spree::CreditCard.column_names.include? "payment_method_id"- add_column :spree_credit_cards, :payment_method_id, :integer- add_index :spree_credit_cards, :payment_method_id- end- end-enddiff --git a/core/db/migrate/20140309023735_migrate_old_preferences.rb b/core/db/migrate/20140309023735_migrate_old_preferences.rbdeleted file mode 100644index 548673f258..0000000000--- a/core/db/migrate/20140309023735_migrate_old_preferences.rb+++ /dev/null@@ -1,27 +0,0 @@-class MigrateOldPreferences < ActiveRecord::Migration[4.2]- def up- if Spree::Calculator.respond_to?(:with_deleted)- migrate_preferences(Spree::Calculator.with_deleted)- else- migrate_preferences(Spree::Calculator)- end- migrate_preferences(Spree::PaymentMethod)- migrate_preferences(Spree::PromotionRule)- end-- def down- end-- private- def migrate_preferences klass- klass.reset_column_information- klass.find_each do |record|- store = Spree::Preferences::ScopedStore.new(record.class.name.underscore, record.id)- record.defined_preferences.each do |key|- value = store.fetch(key){}- record.preferences[key] = value unless value.nil?- end- record.save!- end- end-enddiff --git a/core/db/migrate/20140309024355_create_spree_stores.rb b/core/db/migrate/20140309024355_create_spree_stores.rbdeleted file mode 100644index 2b6e0a1d65..0000000000--- a/core/db/migrate/20140309024355_create_spree_stores.rb+++ /dev/null@@ -1,25 +0,0 @@-class CreateSpreeStores < ActiveRecord::Migration[4.2]- def change- if data_source_exists?(:spree_stores)- rename_column :spree_stores, :domains, :url- rename_column :spree_stores, :email, :mail_from_address- add_column :spree_stores, :meta_description, :text- add_column :spree_stores, :meta_keywords, :text- add_column :spree_stores, :seo_title, :string- else- create_table :spree_stores do |t|- t.string :name- t.string :url- t.text :meta_description- t.text :meta_keywords- t.string :seo_title- t.string :mail_from_address- t.string :default_currency- t.string :code- t.boolean :default, default: false, null: false-- t.timestamps null: false, precision: 6- end- end- end-enddiff --git a/core/db/migrate/20140309033438_create_store_from_preferences.rb b/core/db/migrate/20140309033438_create_store_from_preferences.rbdeleted file mode 100644index c149203821..0000000000--- a/core/db/migrate/20140309033438_create_store_from_preferences.rb+++ /dev/null@@ -1,57 +0,0 @@-class CreateStoreFromPreferences < ActiveRecord::Migration[4.2]- def change- # workaround for spree_i18n and Store translations- Spree::Store.class_eval do- def self.translated?(name)- false- end- end-- # workaround for missing deleted_at column added in later migrations- unless Spree::Store.column_names.include?('deleted_at')- ActiveRecord::Validations::UniquenessParanoiaValidator.module_eval do- def build_relation(klass, *args)- super- end- end-- Spree::Store.class_eval do- def self.paranoia_scope- unscoped- end- end- end-- preference_store = Spree::Preferences::Store.instance- if store = Spree::Store.where(default: true).first- store.meta_description = preference_store.get('spree/app_configuration/default_meta_description') {}- store.meta_keywords = preference_store.get('spree/app_configuration/default_meta_keywords') {}- store.seo_title = preference_store.get('spree/app_configuration/default_seo_title') {}- store.default_currency = preference_store.get('spree/app_configuration/currency') { 'USD' }- store.save!- else- # we set defaults for the things we now require- Spree::Store.new do |s|- s.name = preference_store.get 'spree/app_configuration/site_name' do- 'Spree Demo Site'- end- s.url = preference_store.get 'spree/app_configuration/site_url' do- 'demo.spreecommerce.org'- end- s.mail_from_address = preference_store.get 'spree/app_configuration/mails_from' do- end-- s.meta_description = preference_store.get('spree/app_configuration/default_meta_description') do- 'This is the new Spree UX DEMO | OVERVIEW: http://bit.ly/new-spree-ux | DOCS: http://bit.ly/spree-ux-customization-docs | CONTACT: https://spreecommerce.org/contact/'- end- s.meta_keywords = preference_store.get('spree/app_configuration/default_meta_keywords') {}- s.seo_title = preference_store.get('spree/app_configuration/default_seo_title') do- 'Spree Commerce Demo Shop'- end- s.default_currency = preference_store.get('spree/app_configuration/currency') { 'USD' }- s.code = 'spree'- end.save!- end- end-enddiff --git a/core/db/migrate/20140315053743_add_timestamps_to_spree_assets.rb b/core/db/migrate/20140315053743_add_timestamps_to_spree_assets.rbdeleted file mode 100644index eefc687799..0000000000--- a/core/db/migrate/20140315053743_add_timestamps_to_spree_assets.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddTimestampsToSpreeAssets < ActiveRecord::Migration[4.2]- def change- add_column :spree_assets, :created_at, :datetime- add_column :spree_assets, :updated_at, :datetime- end-enddiff --git a/core/db/migrate/20140318191500_create_spree_taxons_promotion_rules.rb b/core/db/migrate/20140318191500_create_spree_taxons_promotion_rules.rbdeleted file mode 100644index 135828cd91..0000000000--- a/core/db/migrate/20140318191500_create_spree_taxons_promotion_rules.rb+++ /dev/null@@ -1,8 +0,0 @@-class CreateSpreeTaxonsPromotionRules < ActiveRecord::Migration[4.2]- def change- create_table :spree_taxons_promotion_rules do |t|- t.references :taxon, index: true- t.references :promotion_rule, index: true- end- end-enddiff --git a/core/db/migrate/20140331100557_add_additional_store_fields.rb b/core/db/migrate/20140331100557_add_additional_store_fields.rbdeleted file mode 100644index 12630d1ad0..0000000000--- a/core/db/migrate/20140331100557_add_additional_store_fields.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddAdditionalStoreFields < ActiveRecord::Migration[4.2]- def change- add_column :spree_stores, :code, :string unless column_exists?(:spree_stores, :code)- add_column :spree_stores, :default, :boolean, default: false, null: false unless column_exists?(:spree_stores, :default)- add_index :spree_stores, :code- add_index :spree_stores, :default- end-enddiff --git a/core/db/migrate/20140410141842_add_many_missing_indexes.rb b/core/db/migrate/20140410141842_add_many_missing_indexes.rbdeleted file mode 100644index b4d2a353ae..0000000000--- a/core/db/migrate/20140410141842_add_many_missing_indexes.rb+++ /dev/null@@ -1,18 +0,0 @@-class AddManyMissingIndexes < ActiveRecord::Migration[4.2]- def change- add_index :spree_adjustments, [:adjustable_id, :adjustable_type]- add_index :spree_adjustments, :eligible- add_index :spree_adjustments, :order_id- add_index :spree_promotions, :code- add_index :spree_promotions, :expires_at- add_index :spree_states, :country_id- add_index :spree_stock_items, :deleted_at- add_index :spree_option_types, :position- add_index :spree_option_values, :position- add_index :spree_product_option_types, :option_type_id- add_index :spree_product_option_types, :product_id- add_index :spree_products_taxons, :position- add_index :spree_promotions, :starts_at- add_index :spree_stores, :url- end-enddiff --git a/core/db/migrate/20140410150358_correct_some_polymorphic_index_and_add_more_missing.rb b/core/db/migrate/20140410150358_correct_some_polymorphic_index_and_add_more_missing.rbdeleted file mode 100644index a705b84346..0000000000--- a/core/db/migrate/20140410150358_correct_some_polymorphic_index_and_add_more_missing.rb+++ /dev/null@@ -1,66 +0,0 @@-class CorrectSomePolymorphicIndexAndAddMoreMissing < ActiveRecord::Migration[4.2]- def change- add_index :spree_addresses, :country_id- add_index :spree_addresses, :state_id- remove_index :spree_adjustments, [:source_type, :source_id]- add_index :spree_adjustments, [:source_id, :source_type]- add_index :spree_credit_cards, :address_id- add_index :spree_gateways, :active- add_index :spree_gateways, :test_mode- add_index :spree_inventory_units, :return_authorization_id- add_index :spree_line_items, :tax_category_id- add_index :spree_log_entries, [:source_id, :source_type]- add_index :spree_orders, :approver_id- add_index :spree_orders, :bill_address_id- add_index :spree_orders, :confirmation_delivered- add_index :spree_orders, :considered_risky- add_index :spree_orders, :created_by_id- add_index :spree_orders, :ship_address_id- add_index :spree_orders, :shipping_method_id- add_index :spree_orders_promotions, [:order_id, :promotion_id]- add_index :spree_payments, [:source_id, :source_type]- add_index :spree_prices, :deleted_at- add_index :spree_product_option_types, :position- add_index :spree_product_properties, :position- add_index :spree_product_properties, :property_id- add_index :spree_products, :shipping_category_id- add_index :spree_products, :tax_category_id- add_index :spree_promotion_action_line_items, :promotion_action_id- add_index :spree_promotion_action_line_items, :variant_id- add_index :spree_promotion_rules, :promotion_id- add_index :spree_promotions, :advertise- add_index :spree_return_authorizations, :number- add_index :spree_return_authorizations, :order_id- add_index :spree_return_authorizations, :stock_location_id- add_index :spree_shipments, :address_id- add_index :spree_shipping_methods, :deleted_at- add_index :spree_shipping_methods, :tax_category_id- add_index :spree_shipping_rates, :selected- add_index :spree_shipping_rates, :tax_rate_id- add_index :spree_state_changes, [:stateful_id, :stateful_type]- add_index :spree_state_changes, :user_id- add_index :spree_stock_items, :backorderable- add_index :spree_stock_locations, :active- add_index :spree_stock_locations, :backorderable_default- add_index :spree_stock_locations, :country_id- add_index :spree_stock_locations, :propagate_all_variants- add_index :spree_stock_locations, :state_id- add_index :spree_tax_categories, :deleted_at- add_index :spree_tax_categories, :is_default- add_index :spree_tax_rates, :deleted_at- add_index :spree_tax_rates, :included_in_price- add_index :spree_tax_rates, :show_rate_in_label- add_index :spree_tax_rates, :tax_category_id- add_index :spree_tax_rates, :zone_id- add_index :spree_taxonomies, :position- add_index :spree_taxons, :position- add_index :spree_trackers, :active- add_index :spree_variants, :deleted_at- add_index :spree_variants, :is_master- add_index :spree_variants, :position- add_index :spree_variants, :track_inventory- add_index :spree_zone_members, :zone_id- add_index :spree_zone_members, [:zoneable_id, :zoneable_type]- add_index :spree_zones, :default_tax- end-enddiff --git a/core/db/migrate/20140415041315_add_user_id_created_by_id_index_to_order.rb b/core/db/migrate/20140415041315_add_user_id_created_by_id_index_to_order.rbdeleted file mode 100644index 318ade50a7..0000000000--- a/core/db/migrate/20140415041315_add_user_id_created_by_id_index_to_order.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddUserIdCreatedByIdIndexToOrder < ActiveRecord::Migration[4.2]- def change- add_index :spree_orders, [:user_id, :created_by_id]- end-enddiff --git a/core/db/migrate/20140508151342_change_spree_price_amount_precision.rb b/core/db/migrate/20140508151342_change_spree_price_amount_precision.rbdeleted file mode 100644index c6ba863e33..0000000000--- a/core/db/migrate/20140508151342_change_spree_price_amount_precision.rb+++ /dev/null@@ -1,8 +0,0 @@-class ChangeSpreePriceAmountPrecision < ActiveRecord::Migration[4.2]- def change- change_column :spree_prices, :amount, :decimal, precision: 10, scale: 2- change_column :spree_line_items, :price, :decimal, precision: 10, scale: 2- change_column :spree_line_items, :cost_price, :decimal, precision: 10, scale: 2- change_column :spree_variants, :cost_price, :decimal, precision: 10, scale: 2- end-enddiff --git a/core/db/migrate/20140518174634_add_token_to_spree_orders.rb b/core/db/migrate/20140518174634_add_token_to_spree_orders.rbdeleted file mode 100644index 021b89a95f..0000000000--- a/core/db/migrate/20140518174634_add_token_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddTokenToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :guest_token, :string- end-enddiff --git a/core/db/migrate/20140530024945_move_order_token_from_tokenized_permission.rb b/core/db/migrate/20140530024945_move_order_token_from_tokenized_permission.rbdeleted file mode 100644index 5e496ab07c..0000000000--- a/core/db/migrate/20140530024945_move_order_token_from_tokenized_permission.rb+++ /dev/null@@ -1,29 +0,0 @@-class MoveOrderTokenFromTokenizedPermission < ActiveRecord::Migration[4.2]- class Spree::TokenizedPermission < Spree::Base- belongs_to :permissable, polymorphic: true- end-- def up- case Spree::Order.connection.adapter_name- when 'SQLite'- Spree::Order.has_one :tokenized_permission, as: :permissable- Spree::Order.includes(:tokenized_permission).each do |o|- o.update_column :guest_token, o.tokenized_permission.token- end- when 'Mysql2', 'MySQL'- execute "UPDATE spree_orders, spree_tokenized_permissions- SET spree_orders.guest_token = spree_tokenized_permissions.token- WHERE spree_tokenized_permissions.permissable_id = spree_orders.id- AND spree_tokenized_permissions.permissable_type = 'Spree::Order'"- else- execute "UPDATE spree_orders- SET guest_token = spree_tokenized_permissions.token- FROM spree_tokenized_permissions- WHERE spree_tokenized_permissions.permissable_id = spree_orders.id- AND spree_tokenized_permissions.permissable_type = 'Spree::Order'"- end- end-- def down- end-enddiff --git a/core/db/migrate/20140601011216_set_shipment_total_for_users_upgrading.rb b/core/db/migrate/20140601011216_set_shipment_total_for_users_upgrading.rbdeleted file mode 100644index cc9274dd51..0000000000--- a/core/db/migrate/20140601011216_set_shipment_total_for_users_upgrading.rb+++ /dev/null@@ -1,10 +0,0 @@-class SetShipmentTotalForUsersUpgrading < ActiveRecord::Migration[4.2]- def up- # NOTE You might not need this at all unless you're upgrading from Spree 2.1.x- # or below. For those upgrading this should populate the Order#shipment_total- # for legacy orders- Spree::Order.complete.where('shipment_total = ?', 0).includes(:shipments).find_each do |order|- order.update_column(:shipment_total, order.shipments.sum(:cost))- end- end-enddiff --git a/core/db/migrate/20140604135309_drop_credit_card_first_name_and_last_name.rb b/core/db/migrate/20140604135309_drop_credit_card_first_name_and_last_name.rbdeleted file mode 100644index e06369ca29..0000000000--- a/core/db/migrate/20140604135309_drop_credit_card_first_name_and_last_name.rb+++ /dev/null@@ -1,6 +0,0 @@-class DropCreditCardFirstNameAndLastName < ActiveRecord::Migration[4.2]- def change- remove_column :spree_credit_cards, :first_name, :string- remove_column :spree_credit_cards, :last_name, :string- end-enddiff --git a/core/db/migrate/20140609201656_add_deleted_at_to_spree_promotion_actions.rb b/core/db/migrate/20140609201656_add_deleted_at_to_spree_promotion_actions.rbdeleted file mode 100644index 1addd26dd6..0000000000--- a/core/db/migrate/20140609201656_add_deleted_at_to_spree_promotion_actions.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddDeletedAtToSpreePromotionActions < ActiveRecord::Migration[4.2]- def change- add_column :spree_promotion_actions, :deleted_at, :datetime- add_index :spree_promotion_actions, :deleted_at- end-enddiff --git a/core/db/migrate/20140616202624_remove_uncaptured_amount_from_spree_payments.rb b/core/db/migrate/20140616202624_remove_uncaptured_amount_from_spree_payments.rbdeleted file mode 100644index b7c8e8a819..0000000000--- a/core/db/migrate/20140616202624_remove_uncaptured_amount_from_spree_payments.rb+++ /dev/null@@ -1,5 +0,0 @@-class RemoveUncapturedAmountFromSpreePayments < ActiveRecord::Migration[4.2]- def change- remove_column :spree_payments, :uncaptured_amount- end-enddiff --git a/core/db/migrate/20140625214618_create_spree_refunds.rb b/core/db/migrate/20140625214618_create_spree_refunds.rbdeleted file mode 100644index 63c90cd513..0000000000--- a/core/db/migrate/20140625214618_create_spree_refunds.rb+++ /dev/null@@ -1,12 +0,0 @@-class CreateSpreeRefunds < ActiveRecord::Migration[4.2]- def change- create_table :spree_refunds do |t|- t.integer :payment_id- t.integer :return_authorization_id- t.decimal :amount, precision: 10, scale: 2, default: 0.0, null: false- t.string :transaction_id-- t.timestamps null: false, precision: 6- end- end-enddiff --git a/core/db/migrate/20140702140656_create_spree_return_authorization_inventory_unit.rb b/core/db/migrate/20140702140656_create_spree_return_authorization_inventory_unit.rbdeleted file mode 100644index 94d3047c40..0000000000--- a/core/db/migrate/20140702140656_create_spree_return_authorization_inventory_unit.rb+++ /dev/null@@ -1,12 +0,0 @@-class CreateSpreeReturnAuthorizationInventoryUnit < ActiveRecord::Migration[4.2]- def change- create_table :spree_return_authorization_inventory_units do |t|- t.integer :return_authorization_id- t.integer :inventory_unit_id- t.integer :exchange_variant_id- t.datetime :received_at-- t.timestamps null: false, precision: 6- end- end-enddiff --git a/core/db/migrate/20140707125621_rename_return_authorization_inventory_unit_to_return_items.rb b/core/db/migrate/20140707125621_rename_return_authorization_inventory_unit_to_return_items.rbdeleted file mode 100644index 54385dd033..0000000000--- a/core/db/migrate/20140707125621_rename_return_authorization_inventory_unit_to_return_items.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameReturnAuthorizationInventoryUnitToReturnItems < ActiveRecord::Migration[4.2]- def change- rename_table :spree_return_authorization_inventory_units, :spree_return_items- end-enddiff --git a/core/db/migrate/20140709160534_backfill_line_item_pre_tax_amount.rb b/core/db/migrate/20140709160534_backfill_line_item_pre_tax_amount.rbdeleted file mode 100644index c43117afd6..0000000000--- a/core/db/migrate/20140709160534_backfill_line_item_pre_tax_amount.rb+++ /dev/null@@ -1,10 +0,0 @@-class BackfillLineItemPreTaxAmount < ActiveRecord::Migration[4.2]- def change- # set pre_tax_amount to discounted_amount - included_tax_total- execute(<<-SQL)- UPDATE spree_line_items- SET pre_tax_amount = ((price * quantity) + promo_total) - included_tax_total- WHERE pre_tax_amount IS NULL;- SQL- end-enddiff --git a/core/db/migrate/20140710041921_recreate_spree_return_authorizations.rb b/core/db/migrate/20140710041921_recreate_spree_return_authorizations.rbdeleted file mode 100644index eb676e3c9e..0000000000--- a/core/db/migrate/20140710041921_recreate_spree_return_authorizations.rb+++ /dev/null@@ -1,55 +0,0 @@-class RecreateSpreeReturnAuthorizations < ActiveRecord::Migration[4.2]- def up- # If the app has any legacy return authorizations then rename the table & columns and leave them there- # for the spree_legacy_return_authorizations extension to pick up with.- # Otherwise just drop the tables/columns as they are no longer used in stock spree. The spree_legacy_return_authorizations- # extension will recreate these tables for dev environments & etc as needed.- if Spree::ReturnAuthorization.exists?- rename_table :spree_return_authorizations, :spree_legacy_return_authorizations- rename_column :spree_inventory_units, :return_authorization_id, :legacy_return_authorization_id- else- drop_table :spree_return_authorizations- remove_column :spree_inventory_units, :return_authorization_id- end-- Spree::Adjustment.where(source_type: 'Spree::ReturnAuthorization').update_all(source_type: 'Spree::LegacyReturnAuthorization')-- # For now just recreate the table as it was. Future changes to the schema (including dropping "amount") will be coming in a- # separate commit.- create_table :spree_return_authorizations do |t|- t.string "number"- t.string "state"- t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false- t.integer "order_id"- t.text "reason"- t.datetime "created_at"- t.datetime "updated_at"- t.integer "stock_location_id"- end-- end-- def down- drop_table :spree_return_authorizations-- Spree::Adjustment.where(source_type: 'Spree::LegacyReturnAuthorization').update_all(source_type: 'Spree::ReturnAuthorization')-- if data_source_exists?(:spree_legacy_return_authorizations)- rename_table :spree_legacy_return_authorizations, :spree_return_authorizations- rename_column :spree_inventory_units, :legacy_return_authorization_id, :return_authorization_id- else- create_table :spree_return_authorizations do |t|- t.string "number"- t.string "state"- t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false- t.integer "order_id"- t.text "reason"- t.datetime "created_at"- t.datetime "updated_at"- t.integer "stock_location_id"- end- add_column :spree_inventory_units, :return_authorization_id, :integer, after: :shipment_id- add_index :spree_inventory_units, :return_authorization_id- end- end-enddiff --git a/core/db/migrate/20140710181204_add_amount_fields_to_return_items.rb b/core/db/migrate/20140710181204_add_amount_fields_to_return_items.rbdeleted file mode 100644index 54f6c2ccea..0000000000--- a/core/db/migrate/20140710181204_add_amount_fields_to_return_items.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddAmountFieldsToReturnItems < ActiveRecord::Migration[4.2]- def change- add_column :spree_return_items, :pre_tax_amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false- add_column :spree_return_items, :included_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- add_column :spree_return_items, :additional_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- end-enddiff --git a/core/db/migrate/20140710190048_drop_return_authorization_amount.rb b/core/db/migrate/20140710190048_drop_return_authorization_amount.rbdeleted file mode 100644index 9decc25762..0000000000--- a/core/db/migrate/20140710190048_drop_return_authorization_amount.rb+++ /dev/null@@ -1,5 +0,0 @@-class DropReturnAuthorizationAmount < ActiveRecord::Migration[4.2]- def change- remove_column :spree_return_authorizations, :amount- end-enddiff --git a/core/db/migrate/20140713140455_create_spree_return_authorization_reasons.rb b/core/db/migrate/20140713140455_create_spree_return_authorization_reasons.rbdeleted file mode 100644index 1dafd6abbc..0000000000--- a/core/db/migrate/20140713140455_create_spree_return_authorization_reasons.rb+++ /dev/null@@ -1,28 +0,0 @@-class CreateSpreeReturnAuthorizationReasons < ActiveRecord::Migration[4.2]- def change- create_table :spree_return_authorization_reasons do |t|- t.string :name- t.boolean :active, default: true- t.boolean :mutable, default: true-- t.timestamps null: false, precision: 6- end-- reversible do |direction|- direction.up do- Spree::ReturnAuthorizationReason.create!(name: 'Better price available')- Spree::ReturnAuthorizationReason.create!(name: 'Missed estimated delivery date')- Spree::ReturnAuthorizationReason.create!(name: 'Missing parts or accessories')- Spree::ReturnAuthorizationReason.create!(name: 'Damaged/Defective')- Spree::ReturnAuthorizationReason.create!(name: 'Different from what was ordered')- Spree::ReturnAuthorizationReason.create!(name: 'Different from description')- Spree::ReturnAuthorizationReason.create!(name: 'No longer needed/wanted')- Spree::ReturnAuthorizationReason.create!(name: 'Accidental order')- Spree::ReturnAuthorizationReason.create!(name: 'Unauthorized purchase')- end- end-- add_column :spree_return_authorizations, :return_authorization_reason_id, :integer- add_index :spree_return_authorizations, :return_authorization_reason_id, name: 'index_return_authorizations_on_return_authorization_reason_id'- end-enddiff --git a/core/db/migrate/20140713140527_create_spree_refund_reasons.rb b/core/db/migrate/20140713140527_create_spree_refund_reasons.rbdeleted file mode 100644index 0c775be96e..0000000000--- a/core/db/migrate/20140713140527_create_spree_refund_reasons.rb+++ /dev/null@@ -1,14 +0,0 @@-class CreateSpreeRefundReasons < ActiveRecord::Migration[4.2]- def change- create_table :spree_refund_reasons do |t|- t.string :name- t.boolean :active, default: true- t.boolean :mutable, default: true-- t.timestamps null: false, precision: 6- end-- add_column :spree_refunds, :refund_reason_id, :integer- add_index :spree_refunds, :refund_reason_id, name: 'index_refunds_on_refund_reason_id'- end-enddiff --git a/core/db/migrate/20140713142214_rename_return_authorization_reason.rb b/core/db/migrate/20140713142214_rename_return_authorization_reason.rbdeleted file mode 100644index 9166ccd7c7..0000000000--- a/core/db/migrate/20140713142214_rename_return_authorization_reason.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameReturnAuthorizationReason < ActiveRecord::Migration[4.2]- def change- rename_column :spree_return_authorizations, :reason, :memo- end-enddiff --git a/core/db/migrate/20140715182625_create_spree_promotion_categories.rb b/core/db/migrate/20140715182625_create_spree_promotion_categories.rbdeleted file mode 100644index 562be6ac70..0000000000--- a/core/db/migrate/20140715182625_create_spree_promotion_categories.rb+++ /dev/null@@ -1,11 +0,0 @@-class CreateSpreePromotionCategories < ActiveRecord::Migration[4.2]- def change- create_table :spree_promotion_categories do |t|- t.string :name- t.timestamps null: false, precision: 6- end-- add_column :spree_promotions, :promotion_category_id, :integer- add_index :spree_promotions, :promotion_category_id- end-enddiff --git a/core/db/migrate/20140716204111_drop_received_at_on_return_items.rb b/core/db/migrate/20140716204111_drop_received_at_on_return_items.rbdeleted file mode 100644index af70d6f2b8..0000000000--- a/core/db/migrate/20140716204111_drop_received_at_on_return_items.rb+++ /dev/null@@ -1,9 +0,0 @@-class DropReceivedAtOnReturnItems < ActiveRecord::Migration[4.2]- def up- remove_column :spree_return_items, :received_at- end-- def down- add_column :spree_return_items, :received_at, :datetime- end-enddiff --git a/core/db/migrate/20140716212330_add_reception_and_acceptance_status_to_return_items.rb b/core/db/migrate/20140716212330_add_reception_and_acceptance_status_to_return_items.rbdeleted file mode 100644index 5afebb3f0f..0000000000--- a/core/db/migrate/20140716212330_add_reception_and_acceptance_status_to_return_items.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddReceptionAndAcceptanceStatusToReturnItems < ActiveRecord::Migration[4.2]- def change- add_column :spree_return_items, :reception_status, :string- add_column :spree_return_items, :acceptance_status, :string- end-enddiff --git a/core/db/migrate/20140717155155_create_default_refund_reason.rb b/core/db/migrate/20140717155155_create_default_refund_reason.rbdeleted file mode 100644index c5f0eaae44..0000000000--- a/core/db/migrate/20140717155155_create_default_refund_reason.rb+++ /dev/null@@ -1,9 +0,0 @@-class CreateDefaultRefundReason < ActiveRecord::Migration[4.2]- def up- Spree::RefundReason.create!(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false)- end-- def down- Spree::RefundReason.find_by(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false).destroy- end-enddiff --git a/core/db/migrate/20140717185932_add_default_to_spree_stock_locations.rb b/core/db/migrate/20140717185932_add_default_to_spree_stock_locations.rbdeleted file mode 100644index 3050837898..0000000000--- a/core/db/migrate/20140717185932_add_default_to_spree_stock_locations.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddDefaultToSpreeStockLocations < ActiveRecord::Migration[4.2]- def change- unless column_exists? :spree_stock_locations, :default- add_column :spree_stock_locations, :default, :boolean, null: false, default: false- end- end-enddiff --git a/core/db/migrate/20140718133010_create_spree_customer_returns.rb b/core/db/migrate/20140718133010_create_spree_customer_returns.rbdeleted file mode 100644index e3a3dc1abe..0000000000--- a/core/db/migrate/20140718133010_create_spree_customer_returns.rb+++ /dev/null@@ -1,9 +0,0 @@-class CreateSpreeCustomerReturns < ActiveRecord::Migration[4.2]- def change- create_table :spree_customer_returns do |t|- t.string :number- t.integer :stock_location_id- t.timestamps null: false, precision: 6- end- end-enddiff --git a/core/db/migrate/20140718133349_add_customer_return_id_to_return_item.rb b/core/db/migrate/20140718133349_add_customer_return_id_to_return_item.rbdeleted file mode 100644index 9266db8251..0000000000--- a/core/db/migrate/20140718133349_add_customer_return_id_to_return_item.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddCustomerReturnIdToReturnItem < ActiveRecord::Migration[4.2]- def change- add_column :spree_return_items, :customer_return_id, :integer- add_index :spree_return_items, :customer_return_id, name: 'index_return_items_on_customer_return_id'- end-enddiff --git a/core/db/migrate/20140718195325_create_friendly_id_slugs.rb b/core/db/migrate/20140718195325_create_friendly_id_slugs.rbdeleted file mode 100644index 1b66194bcb..0000000000--- a/core/db/migrate/20140718195325_create_friendly_id_slugs.rb+++ /dev/null@@ -1,15 +0,0 @@-class CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2]- def change- create_table :friendly_id_slugs do |t|- t.string :slug, null: false- t.integer :sluggable_id, null: false- t.string :sluggable_type, limit: 50- t.string :scope- t.datetime :created_at- end- add_index :friendly_id_slugs, :sluggable_id- add_index :friendly_id_slugs, [:slug, :sluggable_type]- add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], unique: true- add_index :friendly_id_slugs, :sluggable_type- end-enddiff --git a/core/db/migrate/20140723004419_rename_spree_refund_return_authorization_id.rb b/core/db/migrate/20140723004419_rename_spree_refund_return_authorization_id.rbdeleted file mode 100644index f15e60eb05..0000000000--- a/core/db/migrate/20140723004419_rename_spree_refund_return_authorization_id.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameSpreeRefundReturnAuthorizationId < ActiveRecord::Migration[4.2]- def change- rename_column :spree_refunds, :return_authorization_id, :customer_return_id- end-enddiff --git a/core/db/migrate/20140723152808_increase_return_item_pre_tax_amount_precision.rb b/core/db/migrate/20140723152808_increase_return_item_pre_tax_amount_precision.rbdeleted file mode 100644index 13cbe3f010..0000000000--- a/core/db/migrate/20140723152808_increase_return_item_pre_tax_amount_precision.rb+++ /dev/null@@ -1,13 +0,0 @@-class IncreaseReturnItemPreTaxAmountPrecision < ActiveRecord::Migration[4.2]- def up- change_column :spree_return_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false- change_column :spree_return_items, :included_tax_total, :decimal, precision: 12, scale: 4, default: 0.0, null: false- change_column :spree_return_items, :additional_tax_total, :decimal, precision: 12, scale: 4, default: 0.0, null: false- end-- def down- change_column :spree_return_items, :pre_tax_amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false- change_column :spree_return_items, :included_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- change_column :spree_return_items, :additional_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false- end-enddiff --git a/core/db/migrate/20140723214541_copy_product_slugs_to_slug_history.rb b/core/db/migrate/20140723214541_copy_product_slugs_to_slug_history.rbdeleted file mode 100644index 4eebf6def8..0000000000--- a/core/db/migrate/20140723214541_copy_product_slugs_to_slug_history.rb+++ /dev/null@@ -1,15 +0,0 @@-class CopyProductSlugsToSlugHistory < ActiveRecord::Migration[4.2]- def change-- # do what sql does best: copy all slugs into history table in a single query- # rather than load potentially millions of products into memory- Spree::Product.connection.execute <<-SQL-INSERT INTO #{FriendlyId::Slug.table_name} (slug, sluggable_id, sluggable_type, created_at)- SELECT slug, id, '#{Spree::Product.to_s}', #{ApplicationRecord.send(:sanitize_sql_array, ['?', Time.current])}- FROM #{Spree::Product.table_name}- WHERE slug IS NOT NULL- ORDER BY id-SQL-- end-enddiff --git a/core/db/migrate/20140725131539_create_spree_reimbursements.rb b/core/db/migrate/20140725131539_create_spree_reimbursements.rbdeleted file mode 100644index a4a44fe9d9..0000000000--- a/core/db/migrate/20140725131539_create_spree_reimbursements.rb+++ /dev/null@@ -1,21 +0,0 @@-class CreateSpreeReimbursements < ActiveRecord::Migration[4.2]- def change- create_table :spree_reimbursements do |t|- t.string :number- t.string :reimbursement_status- t.integer :customer_return_id- t.integer :order_id- t.decimal :total, precision: 10, scale: 2-- t.timestamps null: false, precision: 6- end-- add_index :spree_reimbursements, :customer_return_id- add_index :spree_reimbursements, :order_id-- remove_column :spree_refunds, :customer_return_id, :integer- add_column :spree_refunds, :reimbursement_id, :integer-- add_column :spree_return_items, :reimbursement_id, :integer- end-enddiff --git a/core/db/migrate/20140728225422_add_promotionable_to_spree_products.rb b/core/db/migrate/20140728225422_add_promotionable_to_spree_products.rbdeleted file mode 100644index 3ed9e7fcc7..0000000000--- a/core/db/migrate/20140728225422_add_promotionable_to_spree_products.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddPromotionableToSpreeProducts < ActiveRecord::Migration[4.2]- def change- add_column :spree_products, :promotionable, :boolean, default: true- end-enddiff --git a/core/db/migrate/20140729133613_add_exchange_inventory_unit_foreign_keys.rb b/core/db/migrate/20140729133613_add_exchange_inventory_unit_foreign_keys.rbdeleted file mode 100644index 2e981a68bc..0000000000--- a/core/db/migrate/20140729133613_add_exchange_inventory_unit_foreign_keys.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddExchangeInventoryUnitForeignKeys < ActiveRecord::Migration[4.2]- def change- add_column :spree_return_items, :exchange_inventory_unit_id, :integer-- add_index :spree_return_items, :exchange_inventory_unit_id- end-enddiff --git a/core/db/migrate/20140730155938_add_acceptance_status_errors_to_return_item.rb b/core/db/migrate/20140730155938_add_acceptance_status_errors_to_return_item.rbdeleted file mode 100644index abf8007b28..0000000000--- a/core/db/migrate/20140730155938_add_acceptance_status_errors_to_return_item.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddAcceptanceStatusErrorsToReturnItem < ActiveRecord::Migration[4.2]- def change- add_column :spree_return_items, :acceptance_status_errors, :text- end-enddiff --git a/core/db/migrate/20140731150017_create_spree_reimbursement_types.rb b/core/db/migrate/20140731150017_create_spree_reimbursement_types.rbdeleted file mode 100644index 3a8c4a0019..0000000000--- a/core/db/migrate/20140731150017_create_spree_reimbursement_types.rb+++ /dev/null@@ -1,20 +0,0 @@-class CreateSpreeReimbursementTypes < ActiveRecord::Migration[4.2]- def change- create_table :spree_reimbursement_types do |t|- t.string :name- t.boolean :active, default: true- t.boolean :mutable, default: true-- t.timestamps null: false, precision: 6- end-- reversible do |direction|- direction.up do- Spree::ReimbursementType.create!(name: Spree::ReimbursementType::ORIGINAL)- end- end-- add_column :spree_return_items, :preferred_reimbursement_type_id, :integer- add_column :spree_return_items, :override_reimbursement_type_id, :integer- end-enddiff --git a/core/db/migrate/20140804185157_add_default_to_shipment_cost.rb b/core/db/migrate/20140804185157_add_default_to_shipment_cost.rbdeleted file mode 100644index 850757e7be..0000000000--- a/core/db/migrate/20140804185157_add_default_to_shipment_cost.rb+++ /dev/null@@ -1,10 +0,0 @@-class AddDefaultToShipmentCost < ActiveRecord::Migration[4.2]- def up- change_column :spree_shipments, :cost, :decimal, precision: 10, scale: 2, default: 0.0- Spree::Shipment.where(cost: nil).update_all(cost: 0)- end-- def down- change_column :spree_shipments, :cost, :decimal, precision: 10, scale: 2- end-enddiff --git a/core/db/migrate/20140805171035_add_default_to_spree_credit_cards.rb b/core/db/migrate/20140805171035_add_default_to_spree_credit_cards.rbdeleted file mode 100644index 853303ed55..0000000000--- a/core/db/migrate/20140805171035_add_default_to_spree_credit_cards.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddDefaultToSpreeCreditCards < ActiveRecord::Migration[4.2]- def change- add_column :spree_credit_cards, :default, :boolean, null: false, default: false- end-enddiff --git a/core/db/migrate/20140806144901_add_type_to_reimbursement_type.rb b/core/db/migrate/20140806144901_add_type_to_reimbursement_type.rbdeleted file mode 100644index 11f6617eb0..0000000000--- a/core/db/migrate/20140806144901_add_type_to_reimbursement_type.rb+++ /dev/null@@ -1,9 +0,0 @@-class AddTypeToReimbursementType < ActiveRecord::Migration[4.2]- def change- add_column :spree_reimbursement_types, :type, :string- add_index :spree_reimbursement_types, :type-- Spree::ReimbursementType.reset_column_information- Spree::ReimbursementType.find_by(name: Spree::ReimbursementType::ORIGINAL).update!(type: 'Spree::ReimbursementType::OriginalPayment')- end-enddiff --git a/core/db/migrate/20140808184039_create_spree_reimbursement_credits.rb b/core/db/migrate/20140808184039_create_spree_reimbursement_credits.rbdeleted file mode 100644index 0669db26e7..0000000000--- a/core/db/migrate/20140808184039_create_spree_reimbursement_credits.rb+++ /dev/null@@ -1,10 +0,0 @@-class CreateSpreeReimbursementCredits < ActiveRecord::Migration[4.2]- def change- create_table :spree_reimbursement_credits do |t|- t.decimal :amount, precision: 10, scale: 2, default: 0.0, null: false- t.integer :reimbursement_id- t.integer :creditable_id- t.string :creditable_type- end- end-enddiff --git a/core/db/migrate/20140827170513_add_meta_title_to_spree_products.rb b/core/db/migrate/20140827170513_add_meta_title_to_spree_products.rbdeleted file mode 100644index 338ec23e91..0000000000--- a/core/db/migrate/20140827170513_add_meta_title_to_spree_products.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddMetaTitleToSpreeProducts < ActiveRecord::Migration[4.2]- def change- change_table :spree_products do |t|- t.string :meta_title- end- end-enddiff --git a/core/db/migrate/20140911173301_add_kind_to_zone.rb b/core/db/migrate/20140911173301_add_kind_to_zone.rbdeleted file mode 100644index e04536447a..0000000000--- a/core/db/migrate/20140911173301_add_kind_to_zone.rb+++ /dev/null@@ -1,11 +0,0 @@-class AddKindToZone < ActiveRecord::Migration[4.2]- def change- add_column :spree_zones, :kind, :string- add_index :spree_zones, :kind-- Spree::Zone.find_each do |zone|- last_type = zone.members.where.not(zoneable_type: nil).pluck(:zoneable_type).last- zone.update_column :kind, last_type.demodulize.underscore if last_type- end- end-enddiff --git a/core/db/migrate/20140924164824_add_code_to_spree_tax_categories.rb b/core/db/migrate/20140924164824_add_code_to_spree_tax_categories.rbdeleted file mode 100644index 755dca8dfc..0000000000--- a/core/db/migrate/20140924164824_add_code_to_spree_tax_categories.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCodeToSpreeTaxCategories < ActiveRecord::Migration[4.2]- def change- add_column :spree_tax_categories, :tax_code, :string- end-enddiff --git a/core/db/migrate/20140927193717_default_pre_tax_amount_should_be_zero.rb b/core/db/migrate/20140927193717_default_pre_tax_amount_should_be_zero.rbdeleted file mode 100644index c0d2e6185c..0000000000--- a/core/db/migrate/20140927193717_default_pre_tax_amount_should_be_zero.rb+++ /dev/null@@ -1,6 +0,0 @@-class DefaultPreTaxAmountShouldBeZero < ActiveRecord::Migration[4.2]- def change- change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 8, scale: 2, default: 0- change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 8, scale: 2, default: 0- end-enddiff --git a/core/db/migrate/20141002191113_add_code_to_spree_shipping_methods.rb b/core/db/migrate/20141002191113_add_code_to_spree_shipping_methods.rbdeleted file mode 100644index ce92d70593..0000000000--- a/core/db/migrate/20141002191113_add_code_to_spree_shipping_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCodeToSpreeShippingMethods < ActiveRecord::Migration[4.2]- def change- add_column :spree_shipping_methods, :code, :string- end-enddiff --git a/core/db/migrate/20141007230328_add_cancel_audit_fields_to_spree_orders.rb b/core/db/migrate/20141007230328_add_cancel_audit_fields_to_spree_orders.rbdeleted file mode 100644index cc316f2e69..0000000000--- a/core/db/migrate/20141007230328_add_cancel_audit_fields_to_spree_orders.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddCancelAuditFieldsToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :canceled_at, :datetime- add_column :spree_orders, :canceler_id, :integer- end-enddiff --git a/core/db/migrate/20141009204607_add_store_id_to_orders.rb b/core/db/migrate/20141009204607_add_store_id_to_orders.rbdeleted file mode 100644index a73c4ee0aa..0000000000--- a/core/db/migrate/20141009204607_add_store_id_to_orders.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddStoreIdToOrders < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :store_id, :integer- if Spree::Store.default.persisted?- Spree::Order.where(store_id: nil).update_all(store_id: Spree::Store.default.id)- end- end-enddiff --git a/core/db/migrate/20141012083513_create_spree_taxons_prototypes.rb b/core/db/migrate/20141012083513_create_spree_taxons_prototypes.rbdeleted file mode 100644index b83f554514..0000000000--- a/core/db/migrate/20141012083513_create_spree_taxons_prototypes.rb+++ /dev/null@@ -1,8 +0,0 @@-class CreateSpreeTaxonsPrototypes < ActiveRecord::Migration[4.2]- def change- create_table :spree_taxons_prototypes do |t|- t.belongs_to :taxon, index: true- t.belongs_to :prototype, index: true- end- end-enddiff --git a/core/db/migrate/20141021194502_add_state_lock_version_to_order.rb b/core/db/migrate/20141021194502_add_state_lock_version_to_order.rbdeleted file mode 100644index 9d04d8c187..0000000000--- a/core/db/migrate/20141021194502_add_state_lock_version_to_order.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddStateLockVersionToOrder < ActiveRecord::Migration[4.2]- def change- add_column :spree_orders, :state_lock_version, :integer, default: 0, null: false- end-enddiff --git a/core/db/migrate/20141023005240_add_counter_cache_from_spree_variants_to_spree_stock_items.rb b/core/db/migrate/20141023005240_add_counter_cache_from_spree_variants_to_spree_stock_items.rbdeleted file mode 100644index 9d3480c008..0000000000--- a/core/db/migrate/20141023005240_add_counter_cache_from_spree_variants_to_spree_stock_items.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddCounterCacheFromSpreeVariantsToSpreeStockItems < ActiveRecord::Migration[4.2]- # This was unnecessary and was removed- def up- end-- def down- end-enddiff --git a/core/db/migrate/20141101231208_fix_adjustment_order_presence.rb b/core/db/migrate/20141101231208_fix_adjustment_order_presence.rbdeleted file mode 100644index 849a14b76c..0000000000--- a/core/db/migrate/20141101231208_fix_adjustment_order_presence.rb+++ /dev/null@@ -1,13 +0,0 @@-class FixAdjustmentOrderPresence < ActiveRecord::Migration[4.2]- def change- say 'Fixing adjustments without direct order reference'- Spree::Adjustment.where(order: nil).find_each do |adjustment|- adjustable = adjustment.adjustable- if adjustable.is_a? Spree::Order- adjustment.update!(order_id: adjustable.id)- else- adjustment.update!(adjustable: adjustable.order)- end- end- end-enddiff --git a/core/db/migrate/20141105213646_update_classifications_positions.rb b/core/db/migrate/20141105213646_update_classifications_positions.rbdeleted file mode 100644index 046b2bd30a..0000000000--- a/core/db/migrate/20141105213646_update_classifications_positions.rb+++ /dev/null@@ -1,9 +0,0 @@-class UpdateClassificationsPositions < ActiveRecord::Migration[4.2]- def up- Spree::Taxon.all.each do |taxon|- taxon.classifications.each_with_index do |c12n, i|- c12n.set_list_position(i + 1)- end- end- end-enddiff --git a/core/db/migrate/20141120135441_add_guest_token_index_to_spree_orders.rb b/core/db/migrate/20141120135441_add_guest_token_index_to_spree_orders.rbdeleted file mode 100644index 9824e515d1..0000000000--- a/core/db/migrate/20141120135441_add_guest_token_index_to_spree_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddGuestTokenIndexToSpreeOrders < ActiveRecord::Migration[4.2]- def change- add_index :spree_orders, :guest_token- end-enddiff --git a/core/db/migrate/20141215232040_remove_token_permissions_table.rb b/core/db/migrate/20141215232040_remove_token_permissions_table.rbdeleted file mode 100644index 4ec659fc63..0000000000--- a/core/db/migrate/20141215232040_remove_token_permissions_table.rb+++ /dev/null@@ -1,6 +0,0 @@-class RemoveTokenPermissionsTable < ActiveRecord::Migration[4.2]- def change- # The MoveOrderTokenFromTokenizedPermission migration never dropped this.- drop_table :spree_tokenized_permissions- end-enddiff --git a/core/db/migrate/20141215235502_remove_extra_products_slug_index.rb b/core/db/migrate/20141215235502_remove_extra_products_slug_index.rbdeleted file mode 100644index 0ca64503ca..0000000000--- a/core/db/migrate/20141215235502_remove_extra_products_slug_index.rb+++ /dev/null@@ -1,5 +0,0 @@-class RemoveExtraProductsSlugIndex < ActiveRecord::Migration[4.2]- def change- remove_index :spree_products, name: :permalink_idx_unique- end-enddiff --git a/core/db/migrate/20141217215630_update_product_slug_index.rb b/core/db/migrate/20141217215630_update_product_slug_index.rbdeleted file mode 100644index 20a3c150c1..0000000000--- a/core/db/migrate/20141217215630_update_product_slug_index.rb+++ /dev/null@@ -1,6 +0,0 @@-class UpdateProductSlugIndex < ActiveRecord::Migration[4.2]- def change- remove_index :spree_products, :slug if index_exists?(:spree_products, :slug)- add_index :spree_products, :slug, unique: true- end-enddiff --git a/core/db/migrate/20141218025915_rename_identifier_to_number_for_payment.rb b/core/db/migrate/20141218025915_rename_identifier_to_number_for_payment.rbdeleted file mode 100644index 6a763e6be4..0000000000--- a/core/db/migrate/20141218025915_rename_identifier_to_number_for_payment.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameIdentifierToNumberForPayment < ActiveRecord::Migration[4.2]- def change- rename_column :spree_payments, :identifier, :number- end-enddiff --git a/core/db/migrate/20150118210639_create_spree_store_credits.rb b/core/db/migrate/20150118210639_create_spree_store_credits.rbdeleted file mode 100644index 6be5cdf0b5..0000000000--- a/core/db/migrate/20150118210639_create_spree_store_credits.rb+++ /dev/null@@ -1,24 +0,0 @@-class CreateSpreeStoreCredits < ActiveRecord::Migration[4.2]- def change- create_table :spree_store_credits do |t|- t.references :user- t.references :category- t.references :created_by- t.decimal :amount, precision: 8, scale: 2, default: 0.0, null: false- t.decimal :amount_used, precision: 8, scale: 2, default: 0.0, null: false- t.text :memo- t.datetime :deleted_at- t.string :currency- t.decimal :amount_authorized, precision: 8, scale: 2, default: 0.0, null: false- t.integer :originator_id- t.string :originator_type- t.integer :type_id- t.timestamps null: false, precision: 6- end-- add_index :spree_store_credits, :deleted_at- add_index :spree_store_credits, :user_id- add_index :spree_store_credits, :type_id- add_index :spree_store_credits, [:originator_id, :originator_type], name: :spree_store_credits_originator- end-enddiff --git a/core/db/migrate/20150118211500_create_spree_store_credit_categories.rb b/core/db/migrate/20150118211500_create_spree_store_credit_categories.rbdeleted file mode 100644index 342ba69068..0000000000--- a/core/db/migrate/20150118211500_create_spree_store_credit_categories.rb+++ /dev/null@@ -1,8 +0,0 @@-class CreateSpreeStoreCreditCategories < ActiveRecord::Migration[4.2]- def change- create_table :spree_store_credit_categories do |t|- t.string :name- t.timestamps null: false, precision: 6- end- end-enddiff --git a/core/db/migrate/20150118212051_create_spree_store_credit_events.rb b/core/db/migrate/20150118212051_create_spree_store_credit_events.rbdeleted file mode 100644index 54038f8ff1..0000000000--- a/core/db/migrate/20150118212051_create_spree_store_credit_events.rb+++ /dev/null@@ -1,17 +0,0 @@-class CreateSpreeStoreCreditEvents < ActiveRecord::Migration[4.2]- def change- create_table :spree_store_credit_events do |t|- t.integer :store_credit_id, null: false- t.string :action, null: false- t.decimal :amount, precision: 8, scale: 2- t.string :authorization_code, null: false- t.decimal :user_total_amount, precision: 8, scale: 2, default: 0.0, null: false- t.integer :originator_id- t.string :originator_type- t.datetime :deleted_at- t.timestamps null: false, precision: 6- end- add_index :spree_store_credit_events, :store_credit_id- add_index :spree_store_credit_events, [:originator_id, :originator_type], name: :spree_store_credit_events_originator- end-enddiff --git a/core/db/migrate/20150118212101_create_spree_store_credit_types.rb b/core/db/migrate/20150118212101_create_spree_store_credit_types.rbdeleted file mode 100644index 894f17ee0d..0000000000--- a/core/db/migrate/20150118212101_create_spree_store_credit_types.rb+++ /dev/null@@ -1,10 +0,0 @@-class CreateSpreeStoreCreditTypes < ActiveRecord::Migration[4.2]- def change- create_table :spree_store_credit_types do |t|- t.string :name- t.integer :priority- t.timestamps null: false, precision: 6- end- add_index :spree_store_credit_types, :priority- end-enddiff --git a/core/db/migrate/20150121022521_remove_environment_from_payment_method.rb b/core/db/migrate/20150121022521_remove_environment_from_payment_method.rbdeleted file mode 100644index eac53ccd71..0000000000--- a/core/db/migrate/20150121022521_remove_environment_from_payment_method.rb+++ /dev/null@@ -1,6 +0,0 @@-class RemoveEnvironmentFromPaymentMethod < ActiveRecord::Migration[4.2]- def up- Spree::PaymentMethod.where('environment != ?', Rails.env).update_all(active: false)- remove_column :spree_payment_methods, :environment- end-enddiff --git a/core/db/migrate/20150122145607_add_resellable_to_return_items.rb b/core/db/migrate/20150122145607_add_resellable_to_return_items.rbdeleted file mode 100644index a9acd96ea7..0000000000--- a/core/db/migrate/20150122145607_add_resellable_to_return_items.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddResellableToReturnItems < ActiveRecord::Migration[4.2]- def change- add_column :spree_return_items, :resellable, :boolean, default: true, null: false- end-enddiff --git a/core/db/migrate/20150122202432_add_code_to_spree_promotion_categories.rb b/core/db/migrate/20150122202432_add_code_to_spree_promotion_categories.rbdeleted file mode 100644index f6b640b2c8..0000000000--- a/core/db/migrate/20150122202432_add_code_to_spree_promotion_categories.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddCodeToSpreePromotionCategories < ActiveRecord::Migration[4.2]- def change- add_column :spree_promotion_categories, :code, :string- end-enddiff --git a/core/db/migrate/20150128032538_remove_environment_from_tracker.rb b/core/db/migrate/20150128032538_remove_environment_from_tracker.rbdeleted file mode 100644index ed697a4606..0000000000--- a/core/db/migrate/20150128032538_remove_environment_from_tracker.rb+++ /dev/null@@ -1,8 +0,0 @@-class RemoveEnvironmentFromTracker < ActiveRecord::Migration[4.2]- class Spree::Tracker < Spree::Base; end-- def up- Spree::Tracker.where('environment != ?', Rails.env).update_all(active: false)- remove_column :spree_trackers, :environment- end-enddiff --git a/core/db/migrate/20150128060325_remove_spree_configurations.rb b/core/db/migrate/20150128060325_remove_spree_configurations.rbdeleted file mode 100644index e37025aeef..0000000000--- a/core/db/migrate/20150128060325_remove_spree_configurations.rb+++ /dev/null@@ -1,16 +0,0 @@-class RemoveSpreeConfigurations < ActiveRecord::Migration[4.2]- def up- drop_table "spree_configurations"- end-- def down- create_table "spree_configurations", force: true do |t|- t.string "name"- t.string "type", limit: 50- t.datetime "created_at"- t.datetime "updated_at"- end-- add_index "spree_configurations", ["name", "type"], name: "index_spree_configurations_on_name_and_type"- end-enddiff --git a/core/db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb b/core/db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rbdeleted file mode 100644index 45924d80ea..0000000000--- a/core/db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb+++ /dev/null@@ -1,13 +0,0 @@-class AddIndexToSpreeStockItemsVariantId < ActiveRecord::Migration[4.2]- def up- unless index_exists? :spree_stock_items, :variant_id- add_index :spree_stock_items, :variant_id- end- end-- def down- if index_exists? :spree_stock_items, :variant_id- remove_index :spree_stock_items, :variant_id- end- end-enddiff --git a/core/db/migrate/20150309161154_ensure_payments_have_numbers.rb b/core/db/migrate/20150309161154_ensure_payments_have_numbers.rbdeleted file mode 100644index fe39b0945d..0000000000--- a/core/db/migrate/20150309161154_ensure_payments_have_numbers.rb+++ /dev/null@@ -1,13 +0,0 @@-class EnsurePaymentsHaveNumbers < ActiveRecord::Migration[4.2]- def change- add_index :spree_payments, :number unless index_exists?(:spree_payments, :number)- Spree::Payment.where(number: nil).find_each do |payment|- begin- payment.save! # to generate a new number we need to save the record- rescue ActiveRecord::RecordNotSaved- Rails.logger.error("Payment with ID = #{payment.id} couldn't be saved")- Rails.logger.error(payment.errors.full_messages.to_sentence)- end- end- end-enddiff --git a/core/db/migrate/20150314013438_add_missing_indexes_on_spree_tables.rb b/core/db/migrate/20150314013438_add_missing_indexes_on_spree_tables.rbdeleted file mode 100644index e851ee3084..0000000000--- a/core/db/migrate/20150314013438_add_missing_indexes_on_spree_tables.rb+++ /dev/null@@ -1,67 +0,0 @@-class AddMissingIndexesOnSpreeTables < ActiveRecord::Migration[4.2]- def change- if data_source_exists?(:spree_promotion_rules_users) && !index_exists?(:spree_promotion_rules_users,- [:user_id, :promotion_rule_id],- name: 'index_promotion_rules_users_on_user_id_and_promotion_rule_id')- add_index :spree_promotion_rules_users,- [:user_id, :promotion_rule_id],- name: 'index_promotion_rules_users_on_user_id_and_promotion_rule_id'- end-- if data_source_exists?(:spree_products_promotion_rules) && !index_exists?(:spree_products_promotion_rules,- [:promotion_rule_id, :product_id],- name: 'index_products_promotion_rules_on_promotion_rule_and_product')- add_index :spree_products_promotion_rules,- [:promotion_rule_id, :product_id],- name: 'index_products_promotion_rules_on_promotion_rule_and_product'- end-- unless index_exists? :spree_orders, :canceler_id- add_index :spree_orders, :canceler_id- end-- unless index_exists? :spree_orders, :store_id- add_index :spree_orders, :store_id- end-- if data_source_exists?(:spree_orders_promotions) && !index_exists?(:spree_orders_promotions, [:promotion_id, :order_id])- add_index :spree_orders_promotions, [:promotion_id, :order_id]- end-- if data_source_exists?(:spree_properties_prototypes) && !index_exists?(:spree_properties_prototypes, :prototype_id)- add_index :spree_properties_prototypes, :prototype_id- end-- if data_source_exists?(:spree_properties_prototypes) && !index_exists?(:spree_properties_prototypes,- [:prototype_id, :property_id],- name: 'index_properties_prototypes_on_prototype_and_property')- add_index :spree_properties_prototypes,- [:prototype_id, :property_id],- name: 'index_properties_prototypes_on_prototype_and_property'- end-- if data_source_exists?(:spree_taxons_prototypes) && !index_exists?(:spree_taxons_prototypes, [:prototype_id, :taxon_id])- add_index :spree_taxons_prototypes, [:prototype_id, :taxon_id]- end-- if data_source_exists?(:spree_option_types_prototypes) && !index_exists?(:spree_option_types_prototypes, :prototype_id)- add_index :spree_option_types_prototypes, :prototype_id- end-- if data_source_exists?(:spree_option_types_prototypes) && !index_exists?(:spree_option_types_prototypes,- [:prototype_id, :option_type_id],- name: 'index_option_types_prototypes_on_prototype_and_option_type')- add_index :spree_option_types_prototypes,- [:prototype_id, :option_type_id],- name: 'index_option_types_prototypes_on_prototype_and_option_type'- end-- if data_source_exists?(:spree_option_values_variants) && !index_exists?(:spree_option_values_variants,- [:option_value_id, :variant_id],- name: 'index_option_values_variants_on_option_value_and_variant')- add_index :spree_option_values_variants,- [:option_value_id, :variant_id],- name: 'index_option_values_variants_on_option_value_and_variant'- end- end-enddiff --git a/core/db/migrate/20150317174308_remove_duplicated_indexes_from_multi_columns.rb b/core/db/migrate/20150317174308_remove_duplicated_indexes_from_multi_columns.rbdeleted file mode 100644index 77f3d96ce2..0000000000--- a/core/db/migrate/20150317174308_remove_duplicated_indexes_from_multi_columns.rb+++ /dev/null@@ -1,18 +0,0 @@-class RemoveDuplicatedIndexesFromMultiColumns < ActiveRecord::Migration[4.2]- def change- remove_index :spree_adjustments, name: "index_adjustments_on_order_id"- remove_index :spree_option_types_prototypes, :prototype_id- add_index :spree_option_types_prototypes, :option_type_id- remove_index :spree_option_values_variants, name: 'index_option_values_variants_on_option_value_and_variant'- remove_index :spree_option_values_variants, :variant_id- add_index :spree_option_values_variants, :option_value_id- remove_index :spree_orders, :user_id- remove_index :spree_orders_promotions, [:order_id, :promotion_id]- add_index :spree_orders_promotions, :order_id- remove_index :spree_products_promotion_rules, name: "index_products_promotion_rules_on_promotion_rule_id"- remove_index :spree_promotion_rules_users, name: "index_promotion_rules_users_on_user_id"- remove_index :spree_properties_prototypes, :prototype_id- remove_index :spree_stock_items, :stock_location_id- remove_index :spree_taxons_prototypes, :prototype_id- end-enddiff --git a/core/db/migrate/20150324104002_remove_user_index_from_spree_state_changes.rb b/core/db/migrate/20150324104002_remove_user_index_from_spree_state_changes.rbdeleted file mode 100644index c8688b255b..0000000000--- a/core/db/migrate/20150324104002_remove_user_index_from_spree_state_changes.rb+++ /dev/null@@ -1,14 +0,0 @@-class RemoveUserIndexFromSpreeStateChanges < ActiveRecord::Migration[4.2]- def up- if index_exists? :spree_state_changes, :user_id- remove_index :spree_state_changes, :user_id- end-- end-- def down- unless index_exists? :spree_state_changes, :user_id- add_index :spree_state_changes, :user_id- end- end-enddiff --git a/core/db/migrate/20150515211137_fix_adjustment_order_id.rb b/core/db/migrate/20150515211137_fix_adjustment_order_id.rbdeleted file mode 100644index 207729c4d8..0000000000--- a/core/db/migrate/20150515211137_fix_adjustment_order_id.rb+++ /dev/null@@ -1,70 +0,0 @@-class FixAdjustmentOrderId < ActiveRecord::Migration[4.2]- def change- say 'Populate order_id from adjustable_id where appropriate'- execute(<<-SQL.squish)- UPDATE- spree_adjustments- SET- order_id = adjustable_id- WHERE- adjustable_type = 'Spree::Order'- ;- SQL-- # Submitter of change does not care about MySQL, as it is not officially supported.- # Still spree officials decided to provide a working code path for MySQL users, hence- # submitter made a AR code path he could validate on PostgreSQL.- #- # Whoever runs a big enough MySQL installation where the AR solution hurts:- # Will have to write a better MySQL specific equivalent.- if Spree::Order.connection.adapter_name.eql?('MySQL')- Spree::Adjustment.where(adjustable_type: 'Spree::LineItem').find_each do |adjustment|- adjustment.update_columns(order_id: Spree::LineItem.find(adjustment.adjustable_id).order_id)- end- else- execute(<<-SQL.squish)- UPDATE- spree_adjustments- SET- order_id =- (SELECT order_id FROM spree_line_items WHERE spree_line_items.id = spree_adjustments.adjustable_id)- WHERE- adjustable_type = 'Spree::LineItem'- SQL- end-- say 'Fix schema for spree_adjustments order_id column'- change_table :spree_adjustments do |t|- t.change :order_id, :integer, null: false- end-- # Improved schema for postgresql, uncomment if you like it:- #- # # Negated Logical implication.- # #- # # When adjustable_type is 'Spree::Order' (p) the adjustable_id must be order_id (q).- # #- # # When adjustable_type is NOT 'Spree::Order' the adjustable id allowed to be any value (including of order_id in- # # case foreign keys match). XOR does not work here.- # #- # # Postgresql does not have an operator for logical implication. So we need to build the following truth table- # # via AND with OR:- # #- # # p q | CHECK = !(p -> q)- # # ------------ # # t t | t- # # t f | f- # # f t | t- # # f f | t- # #- # # According to de-morgans law the logical implication q -> p is equivalent to !p || q- # #- # execute(<<-SQL.squish)- # ALTER TABLE ONLY spree_adjustments- # ADD CONSTRAINT fk_spree_adjustments FOREIGN KEY (order_id)- # REFERENCES spree_orders(id) ON UPDATE RESTRICT ON DELETE RESTRICT,- # ADD CONSTRAINT check_spree_adjustments_order_id CHECK- # (adjustable_type <> 'Spree::Order' OR order_id = adjustable_id);- # SQL- end-enddiff --git a/core/db/migrate/20150522071831_add_position_to_spree_payment_methods.rb b/core/db/migrate/20150522071831_add_position_to_spree_payment_methods.rbdeleted file mode 100644index 07515d3858..0000000000--- a/core/db/migrate/20150522071831_add_position_to_spree_payment_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddPositionToSpreePaymentMethods < ActiveRecord::Migration[4.2]- def change- add_column :spree_payment_methods, :position, :integer, default: 0- end-enddiff --git a/core/db/migrate/20150522181728_add_deleted_at_to_friendly_id_slugs.rb b/core/db/migrate/20150522181728_add_deleted_at_to_friendly_id_slugs.rbdeleted file mode 100644index 0cfd37fa00..0000000000--- a/core/db/migrate/20150522181728_add_deleted_at_to_friendly_id_slugs.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddDeletedAtToFriendlyIdSlugs < ActiveRecord::Migration[4.2]- def change- add_column :friendly_id_slugs, :deleted_at, :datetime- add_index :friendly_id_slugs, :deleted_at- end-enddiff --git a/core/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb b/core/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rbdeleted file mode 100644index 7c1ed07d03..0000000000--- a/core/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb+++ /dev/null@@ -1,16 +0,0 @@-class IncreaseScaleOnPreTaxAmounts < ActiveRecord::Migration[4.2]- def change- # set pre_tax_amount on shipments to discounted_amount - included_tax_total- # so that the null: false option on the shipment pre_tax_amount doesn't generate- # errors.- #- execute(<<-SQL)- UPDATE spree_shipments- SET pre_tax_amount = (cost + promo_total) - included_tax_total- WHERE pre_tax_amount IS NULL;- SQL-- change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false- change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false- end-enddiff --git a/core/db/migrate/20150626181949_add_taxable_adjustment_total_to_line_item.rb b/core/db/migrate/20150626181949_add_taxable_adjustment_total_to_line_item.rbdeleted file mode 100644index 5811262a29..0000000000--- a/core/db/migrate/20150626181949_add_taxable_adjustment_total_to_line_item.rb+++ /dev/null@@ -1,19 +0,0 @@-class AddTaxableAdjustmentTotalToLineItem < ActiveRecord::Migration[4.2]- def change- add_column :spree_line_items, :taxable_adjustment_total, :decimal,- precision: 10, scale: 2, default: 0.0, null: false- add_column :spree_line_items, :non_taxable_adjustment_total, :decimal,- precision: 10, scale: 2, default: 0.0, null: false-- add_column :spree_shipments, :taxable_adjustment_total, :decimal,- precision: 10, scale: 2, default: 0.0, null: false- add_column :spree_shipments, :non_taxable_adjustment_total, :decimal,- precision: 10, scale: 2, default: 0.0, null: false-- add_column :spree_orders, :taxable_adjustment_total, :decimal,- precision: 10, scale: 2, default: 0.0, null: false- add_column :spree_orders, :non_taxable_adjustment_total, :decimal,- precision: 10, scale: 2, default: 0.0, null: false- # TODO migration that updates old orders- end-enddiff --git a/core/db/migrate/20150627090949_migrate_payment_methods_display.rb b/core/db/migrate/20150627090949_migrate_payment_methods_display.rbdeleted file mode 100644index 7ff7d4f09b..0000000000--- a/core/db/migrate/20150627090949_migrate_payment_methods_display.rb+++ /dev/null@@ -1,12 +0,0 @@-class MigratePaymentMethodsDisplay < ActiveRecord::Migration[4.2]- def change- Spree::PaymentMethod.all.each do |method|- if method.display_on.blank?- method.display_on = "both"- method.save- end- end-- change_column :spree_payment_methods, :display_on, :string, default: "both"- end-enddiff --git a/core/db/migrate/20150707204155_enable_acts_as_paranoid_on_calculators.rb b/core/db/migrate/20150707204155_enable_acts_as_paranoid_on_calculators.rbdeleted file mode 100644index d7d4a17bd6..0000000000--- a/core/db/migrate/20150707204155_enable_acts_as_paranoid_on_calculators.rb+++ /dev/null@@ -1,6 +0,0 @@-class EnableActsAsParanoidOnCalculators < ActiveRecord::Migration[4.2]- def change- add_column :spree_calculators, :deleted_at, :datetime- add_index :spree_calculators, :deleted_at- end-enddiff --git a/core/db/migrate/20150714154102_spree_payment_method_store_credits.rb b/core/db/migrate/20150714154102_spree_payment_method_store_credits.rbdeleted file mode 100644index e3437e0ac4..0000000000--- a/core/db/migrate/20150714154102_spree_payment_method_store_credits.rb+++ /dev/null@@ -1,12 +0,0 @@-class SpreePaymentMethodStoreCredits < ActiveRecord::Migration[4.2]- def up- # Reload to pick up new position column for acts_as_list- Spree::PaymentMethod.reset_column_information- Spree::PaymentMethod::StoreCredit.find_or_create_by(name: 'Store Credit', description: 'Store Credit',- active: true, display_on: 'back_end')- end-- def down- Spree::PaymentMethod.find_by(type: 'Spree::PaymentMethod::StoreCredit', name: 'Store Credit').try(&:destroy)- end-enddiff --git a/core/db/migrate/20150726141425_rename_has_and_belongs_to_associations_to_model_names.rb b/core/db/migrate/20150726141425_rename_has_and_belongs_to_associations_to_model_names.rbdeleted file mode 100644index d3909cc16a..0000000000--- a/core/db/migrate/20150726141425_rename_has_and_belongs_to_associations_to_model_names.rb+++ /dev/null@@ -1,18 +0,0 @@-class RenameHasAndBelongsToAssociationsToModelNames < ActiveRecord::Migration[4.2]- def change- {- 'spree_option_types_prototypes' => 'spree_option_type_prototypes',- 'spree_option_values_variants' => 'spree_option_value_variants',- 'spree_orders_promotions' => 'spree_order_promotions',- 'spree_products_promotion_rules' => 'spree_product_promotion_rules',- 'spree_taxons_promotion_rules' => 'spree_promotion_rule_taxons',- 'spree_promotion_rules_users' => 'spree_promotion_rule_users',- 'spree_properties_prototypes' => 'spree_property_prototypes',- 'spree_taxons_prototypes' => 'spree_prototype_taxons',- 'spree_roles_users' => 'spree_role_users',- 'spree_shipping_methods_zones' => 'spree_shipping_method_zones'- }.each do |old_name, new_name|- rename_table old_name, new_name- end- end-enddiff --git a/core/db/migrate/20150727191614_spree_store_credit_types.rb b/core/db/migrate/20150727191614_spree_store_credit_types.rbdeleted file mode 100644index a8bc74a1d7..0000000000--- a/core/db/migrate/20150727191614_spree_store_credit_types.rb+++ /dev/null@@ -1,11 +0,0 @@-class SpreeStoreCreditTypes < ActiveRecord::Migration[4.2]- def up- Spree::StoreCreditType.find_or_create_by(name: 'Expiring', priority: 1)- Spree::StoreCreditType.find_or_create_by(name: 'Non-expiring', priority: 2)- end-- def down- Spree::StoreCreditType.find_by(name: 'Expiring').try(&:destroy)- Spree::StoreCreditType.find_by(name: 'Non-expiring').try(&:destroy)- end-enddiff --git a/core/db/migrate/20150819154308_add_discontinued_to_products_and_variants.rb b/core/db/migrate/20150819154308_add_discontinued_to_products_and_variants.rbdeleted file mode 100644index 1b37f2fe6d..0000000000--- a/core/db/migrate/20150819154308_add_discontinued_to_products_and_variants.rb+++ /dev/null@@ -1,68 +0,0 @@-class AddDiscontinuedToProductsAndVariants < ActiveRecord::Migration[4.2]- def up- add_column :spree_products, :discontinue_on, :datetime, after: :available_on- add_column :spree_variants, :discontinue_on, :datetime, after: :deleted_at-- add_index :spree_products, :discontinue_on- add_index :spree_variants, :discontinue_on-- puts "Warning: This migration changes the meaning of 'deleted'. Before this change, 'deleted' meant products that were no longer being sold in your store. After this change, you can only delete a product or variant if it has not already been sold to a customer (a model-level check enforces this). Instead, you should use the new field 'discontinue_on' for products or variants which were sold in the past but no longer for sale. This fixes bugs when other objects are attached to deleted products and variants. (Even though acts_as_paranoid gem keeps the records in the database, most associations are automatically scoped to exclude the deleted records.) In thew meaning of 'deleted,' you can still use the delete function on products & variants which are *truly user-error mistakes*, specifically before an order has been placed or the items have gone on sale. You also must use the soft-delete function (which still works after this change) to clean up slug (product) and SKU (variant) duplicates. Otherwise, you should generally over ever need to discontinue products.--Data Fix: We will attempt to reverse engineer the old meaning of 'deleted' (no longer for sale) to the new database field 'discontinue_on'. However, since Slugs and SKUs cannot be duplicated on Products and Variants, we cannot gaurantee this to be foolproof if you have deteled Products and Variants that have duplicate Slugs or SKUs in non-deleted records. In these cases, we recommend you use the additional rake task to clean up your old records (see rake db:fix_orphan_line_items). If you have such records, this migration will leave them in place, preferring the non-deleted records over the deleted ones. However, since old line items will still be associated with deleted objects, you will still the bugs in your app until you run:--rake db:fix_orphan_line_items--We will print out a report of the data we are fixing now: "-- Spree::Product.only_deleted.each do |product|- # determine if there is a slug duplicate- the_dup = Spree::Product.find_by(slug: product.slug)- if the_dup.nil?- # check to see if there are line items attached to any variants- if Spree::Variant.with_deleted.where(product_id: product.id).map(&:line_items).any?- puts "recovering deleted product id #{product.id} ... this will un-delete the record and set it to be discontinued"-- old_deleted = product.deleted_at- product.update_column(:deleted_at, nil) # for some reason .recover doesn't appear to be a method- product.update_column(:discontinue_on, old_deleted)- else- puts "leaving product id #{product.id} deleted because there are no line items attached to it..."- end- else- puts "leaving product id #{product.id} deleted because there is a duplicate slug for '#{product.slug}' (product id #{the_dup.id}) "- if product.variants.map(&:line_items).any?- puts "WARNING: You may still have bugs with product id #{product.id} (#{product.name}) until you run rake db:fix_orphan_line_items"- end- end- end-- Spree::Variant.only_deleted.each do |variant|- # determine if there is a slug duplicate- the_dup = Spree::Variant.find_by(sku: variant.sku)- if the_dup.nil?- # check to see if there are line items attached to any variants- if variant.line_items.any?- puts "recovering deleted variant id #{variant.id} ... this will un-delete the record and set it to be discontinued"- old_deleted = variant.deleted_at- variant.update_column(:deleted_at, nil) # for some reason .recover doesn't appear to be a method- variant.update_column(:discontinue_on, old_deleted)- else- puts "leaving variant id #{variant.id} deleted because there are no line items attached to it..."- end- else- puts "leaving variant id #{variant.id} deleted because there is a duplicate SKU for '#{variant.sku}' (variant id #{the_dup.id}) "- if variant.line_items.any?- puts "WARNING: You may still have bugs with variant id #{variant.id} (#{variant.name}) until you run rake db:fix_orphan_line_items"- end- end- end- end-- def down- execute "UPDATE spree_products SET deleted_at = discontinue_on WHERE deleted_at IS NULL"- execute "UPDATE spree_variants SET deleted_at = discontinue_on WHERE deleted_at IS NULL"-- remove_column :spree_products, :discontinue_on- remove_column :spree_variants, :discontinue_on- end-enddiff --git a/core/db/migrate/20151220072838_remove_shipping_method_id_from_spree_orders.rb b/core/db/migrate/20151220072838_remove_shipping_method_id_from_spree_orders.rbdeleted file mode 100644index d7250b03e6..0000000000--- a/core/db/migrate/20151220072838_remove_shipping_method_id_from_spree_orders.rb+++ /dev/null@@ -1,13 +0,0 @@-class RemoveShippingMethodIdFromSpreeOrders < ActiveRecord::Migration[4.2]- def up- if column_exists?(:spree_orders, :shipping_method_id, :integer)- remove_column :spree_orders, :shipping_method_id, :integer- end- end-- def down- unless column_exists?(:spree_orders, :shipping_method_id, :integer)- add_column :spree_orders, :shipping_method_id, :integer- end- end-enddiff --git a/core/db/migrate/20160207191757_add_id_column_to_earlier_habtm_tables.rb b/core/db/migrate/20160207191757_add_id_column_to_earlier_habtm_tables.rbdeleted file mode 100644index 29292e5dfe..0000000000--- a/core/db/migrate/20160207191757_add_id_column_to_earlier_habtm_tables.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddIdColumnToEarlierHabtmTables < ActiveRecord::Migration[4.2]- def up- add_column :spree_option_type_prototypes, :id, :primary_key- add_column :spree_option_value_variants, :id, :primary_key- add_column :spree_order_promotions, :id, :primary_key- add_column :spree_product_promotion_rules, :id, :primary_key- add_column :spree_promotion_rule_users, :id, :primary_key- add_column :spree_property_prototypes, :id, :primary_key- add_column :spree_role_users, :id, :primary_key- add_column :spree_shipping_method_zones, :id, :primary_key- end-- def down- raise ActiveRecord::IrreversibleMigration- end-enddiff --git a/core/db/migrate/20160219165458_add_indexes.rb b/core/db/migrate/20160219165458_add_indexes.rbdeleted file mode 100644index c82c0258c2..0000000000--- a/core/db/migrate/20160219165458_add_indexes.rb+++ /dev/null@@ -1,14 +0,0 @@-class AddIndexes < ActiveRecord::Migration[4.2]- def change- add_index :spree_assets, :position- add_index :spree_option_types, :name- add_index :spree_option_values, :name- add_index :spree_prices, :variant_id- add_index :spree_properties, :name- add_index :spree_roles, :name- add_index :spree_shipping_categories, :name- add_index :spree_taxons, :lft- add_index :spree_taxons, :rgt- add_index :spree_taxons, :name- end-enddiff --git a/core/db/migrate/20160509064646_remove_counter_cache_from_spree_variants_to_spree_stock_items.rb b/core/db/migrate/20160509064646_remove_counter_cache_from_spree_variants_to_spree_stock_items.rbdeleted file mode 100644index 7f4961ff1e..0000000000--- a/core/db/migrate/20160509064646_remove_counter_cache_from_spree_variants_to_spree_stock_items.rb+++ /dev/null@@ -1,10 +0,0 @@-class RemoveCounterCacheFromSpreeVariantsToSpreeStockItems < ActiveRecord::Migration[4.2]- def up- if column_exists?(:spree_variants, :stock_items_count)- remove_column :spree_variants, :stock_items_count- end- end-- def down- end-enddiff --git a/core/db/migrate/20160608090604_add_zipcode_required_to_spree_countries.rb b/core/db/migrate/20160608090604_add_zipcode_required_to_spree_countries.rbdeleted file mode 100644index c5c1e2d91a..0000000000--- a/core/db/migrate/20160608090604_add_zipcode_required_to_spree_countries.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddZipcodeRequiredToSpreeCountries < ActiveRecord::Migration[4.2]- def change- add_column :spree_countries, :zipcode_required, :boolean, default: true- Spree::Country.reset_column_information- Spree::Country.where(iso: Spree::Address::NO_ZIPCODE_ISO_CODES).update_all(zipcode_required: false)- end-enddiff --git a/core/db/migrate/20161014145148_add_created_at_to_variant.rb b/core/db/migrate/20161014145148_add_created_at_to_variant.rbdeleted file mode 100644index 61fb0e295b..0000000000--- a/core/db/migrate/20161014145148_add_created_at_to_variant.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddCreatedAtToVariant < ActiveRecord::Migration[5.0]- def change- add_column :spree_variants, :created_at, :datetime- Spree::Variant.reset_column_information- Spree::Variant.unscoped.where.not(updated_at: nil).update_all('created_at = updated_at')- Spree::Variant.unscoped.where(updated_at: nil).update_all(created_at: Time.current, updated_at: Time.current)- end-enddiff --git a/core/db/migrate/20161014152814_add_null_false_to_spree_variants_timestamps.rb b/core/db/migrate/20161014152814_add_null_false_to_spree_variants_timestamps.rbdeleted file mode 100644index 8cf0901761..0000000000--- a/core/db/migrate/20161014152814_add_null_false_to_spree_variants_timestamps.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddNullFalseToSpreeVariantsTimestamps < ActiveRecord::Migration[5.0]- def change- change_column_null :spree_variants, :created_at, false- change_column_null :spree_variants, :updated_at, false- end-enddiff --git a/core/db/migrate/20161125065505_add_quantity_to_inventory_units.rb b/core/db/migrate/20161125065505_add_quantity_to_inventory_units.rbdeleted file mode 100644index 5bd8628b66..0000000000--- a/core/db/migrate/20161125065505_add_quantity_to_inventory_units.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddQuantityToInventoryUnits < ActiveRecord::Migration[5.0]- def change- add_column :spree_inventory_units, :quantity, :integer, default: 1- end-enddiff --git a/core/db/migrate/20170119122701_add_original_return_item_id_to_spree_inventory_units.rb b/core/db/migrate/20170119122701_add_original_return_item_id_to_spree_inventory_units.rbdeleted file mode 100644index 04942b4eae..0000000000--- a/core/db/migrate/20170119122701_add_original_return_item_id_to_spree_inventory_units.rb+++ /dev/null@@ -1,29 +0,0 @@-class AddOriginalReturnItemIdToSpreeInventoryUnits < ActiveRecord::Migration[5.0]- def up- add_reference :spree_inventory_units, :original_return_item, references: :spree_return_items, index: true-- Spree::InventoryUnit.reset_column_information-- Spree::ReturnItem.where.not(exchange_inventory_unit_id: nil).find_each do |return_item|- if (inventory_unit = Spree::InventoryUnit.find_by(id: return_item.exchange_inventory_unit_id)).present?- inventory_unit.update_column(:original_return_item_id, return_item.id)- end- end-- remove_column :spree_return_items, :exchange_inventory_unit_id- end-- def down- add_reference :spree_return_items, :exchange_inventory_unit, references: :spree_inventory_units, index: true-- Spree::InventoryUnit.reset_column_information-- Spree::InventoryUnit.where.not(original_return_item_id: nil).find_each do |inventory_unit|- if (return_item = Spree::ReturnItem.find_by(id: inventory_unit.original_return_item_id)).present?- return_item.update_column(:exchange_inventory_unit_id, inventory_unit.id)- end- end-- remove_reference :spree_inventory_units, :original_return_item- end-enddiff --git a/core/db/migrate/20170315152755_add_unique_index_on_number_to_spree_orders.rb b/core/db/migrate/20170315152755_add_unique_index_on_number_to_spree_orders.rbdeleted file mode 100644index b56e6ed397..0000000000--- a/core/db/migrate/20170315152755_add_unique_index_on_number_to_spree_orders.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddUniqueIndexOnNumberToSpreeOrders < ActiveRecord::Migration[5.0]- def change- unless index_exists?(:spree_orders, :number, unique: true)- numbers = Spree::Order.group(:number).having('sum(1) > 1').pluck(:number)- orders = Spree::Order.where(number: numbers)-- orders.find_each do |order|- order.number = order.class.number_generator.method(:generate_permalink).call(order.class)- order.save- end-- remove_index :spree_orders, :number if index_exists?(:spree_orders, :number)- add_index :spree_orders, :number, unique: true- end- end-enddiff --git a/core/db/migrate/20170316154338_add_unique_index_on_number_to_spree_stock_transfer.rb b/core/db/migrate/20170316154338_add_unique_index_on_number_to_spree_stock_transfer.rbdeleted file mode 100644index 292f5b8eb8..0000000000--- a/core/db/migrate/20170316154338_add_unique_index_on_number_to_spree_stock_transfer.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddUniqueIndexOnNumberToSpreeStockTransfer < ActiveRecord::Migration[5.0]- def change- unless index_exists?(:spree_stock_transfers, :number, unique: true)- numbers = Spree::StockTransfer.group(:number).having('sum(1) > 1').pluck(:number)- transfers = Spree::StockTransfer.where(number: numbers)-- transfers.find_each do |transfer|- transfer.number = transfer.class.number_generator.method(:generate_permalink).call(transfer.class)- transfer.save- end-- remove_index :spree_stock_transfers, :number if index_exists?(:spree_stock_transfers, :number)- add_index :spree_stock_transfers, :number, unique: true- end- end-enddiff --git a/core/db/migrate/20170316205511_add_unique_index_on_number_to_spree_shipment.rb b/core/db/migrate/20170316205511_add_unique_index_on_number_to_spree_shipment.rbdeleted file mode 100644index 167d45f0be..0000000000--- a/core/db/migrate/20170316205511_add_unique_index_on_number_to_spree_shipment.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddUniqueIndexOnNumberToSpreeShipment < ActiveRecord::Migration[5.0]- def change- unless index_exists?(:spree_shipments, :number, unique: true)- numbers = Spree::Shipment.group(:number).having('sum(1) > 1').pluck(:number)- shipments = Spree::Shipment.where(number: numbers)-- shipments.find_each do |shipment|- shipment.number = shipment.class.number_generator.method(:generate_permalink).call(shipment.class)- shipment.save- end-- remove_index :spree_shipments, :number if index_exists?(:spree_shipments, :number)- add_index :spree_shipments, :number, unique: true- end- end-enddiff --git a/core/db/migrate/20170320134043_add_unique_index_on_number_to_spree_payments.rb b/core/db/migrate/20170320134043_add_unique_index_on_number_to_spree_payments.rbdeleted file mode 100644index 98f1204da6..0000000000--- a/core/db/migrate/20170320134043_add_unique_index_on_number_to_spree_payments.rb+++ /dev/null@@ -1,17 +0,0 @@-class AddUniqueIndexOnNumberToSpreePayments < ActiveRecord::Migration[5.0]- def change- unless index_exists?(:spree_payments, :number, unique: true)- # default scope in Spree::Payment disturbs Postgres, hence `unscoped` is needed.- numbers = Spree::Payment.unscoped.group(:number).having('sum(1) > 1').pluck(:number)- payments = Spree::Payment.where(number: numbers)-- payments.find_each do |payment|- payment.number = payment.class.number_generator.method(:generate_permalink).call(payment.class)- payment.save- end-- remove_index :spree_payments, :number if index_exists?(:spree_payments, :number)- add_index :spree_payments, :number, unique: true- end- end-enddiff --git a/core/db/migrate/20170320142750_add_unique_index_on_number_to_spree_return_authorizations.rb b/core/db/migrate/20170320142750_add_unique_index_on_number_to_spree_return_authorizations.rbdeleted file mode 100644index 0aedf02e30..0000000000--- a/core/db/migrate/20170320142750_add_unique_index_on_number_to_spree_return_authorizations.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddUniqueIndexOnNumberToSpreeReturnAuthorizations < ActiveRecord::Migration[5.0]- def change- unless index_exists?(:spree_return_authorizations, :number, unique: true)- numbers = Spree::ReturnAuthorization.group(:number).having('sum(1) > 1').pluck(:number)- authorizations = Spree::ReturnAuthorization.where(number: numbers)-- authorizations.find_each do |authorization|- authorization.number = authorization.class.number_generator.method(:generate_permalink).call(authorization.class)- authorization.save- end-- remove_index :spree_return_authorizations, :number if index_exists?(:spree_return_authorizations, :number)- add_index :spree_return_authorizations, :number, unique: true- end- end-enddiff --git a/core/db/migrate/20170320145040_add_unique_index_on_number_to_spree_customer_returns.rb b/core/db/migrate/20170320145040_add_unique_index_on_number_to_spree_customer_returns.rbdeleted file mode 100644index 5c33510caa..0000000000--- a/core/db/migrate/20170320145040_add_unique_index_on_number_to_spree_customer_returns.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddUniqueIndexOnNumberToSpreeCustomerReturns < ActiveRecord::Migration[5.0]- def change- unless index_exists?(:spree_customer_returns, :number, unique: true)- numbers = Spree::CustomerReturn.group(:number).having('sum(1) > 1').pluck(:number)- returns = Spree::CustomerReturn.where(number: numbers)-- returns.find_each do |r|- r.number = r.class.number_generator.method(:generate_permalink).call(r.class)- r.save- end-- remove_index :spree_customer_returns, :number if index_exists?(:spree_customer_returns, :number)- add_index :spree_customer_returns, :number, unique: true- end- end-enddiff --git a/core/db/migrate/20170320145518_add_unique_index_on_number_to_spree_reimbursements.rb b/core/db/migrate/20170320145518_add_unique_index_on_number_to_spree_reimbursements.rbdeleted file mode 100644index af338dc2eb..0000000000--- a/core/db/migrate/20170320145518_add_unique_index_on_number_to_spree_reimbursements.rb+++ /dev/null@@ -1,16 +0,0 @@-class AddUniqueIndexOnNumberToSpreeReimbursements < ActiveRecord::Migration[5.0]- def change- unless index_exists?(:spree_reimbursements, :number, unique: true)- numbers = Spree::Reimbursement.group(:number).having('sum(1) > 1').pluck(:number)- reimbursements = Spree::Reimbursement.where(number: numbers)-- reimbursements.find_each do |reimbursement|- reimbursement.number = reimbursement.class.number_generator.method(:generate_permalink).call(reimbursement.class)- reimbursement.save- end-- remove_index :spree_reimbursements, :number if index_exists?(:spree_reimbursements, :number)- add_index :spree_reimbursements, :number, unique: true- end- end-enddiff --git a/core/db/migrate/20170323151450_add_missing_unique_indexes_for_unique_attributes.rb b/core/db/migrate/20170323151450_add_missing_unique_indexes_for_unique_attributes.rbdeleted file mode 100644index b905a359a1..0000000000--- a/core/db/migrate/20170323151450_add_missing_unique_indexes_for_unique_attributes.rb+++ /dev/null@@ -1,37 +0,0 @@-class AddMissingUniqueIndexesForUniqueAttributes < ActiveRecord::Migration[5.0]- def change- tables = {- country: [:name, :iso_name],- refund_reason: [:name],- reimbursement_type: [:name],- return_authorization_reason: [:name],- role: [:name],- store: [:code]- }-- tables.each do |table, columns|- table_class = "Spree::#{table.to_s.classify}".constantize- table_name = table_class.table_name-- columns.each do |column|- unless index_exists?(table_name, column, unique: true)- attributes = table_class.unscoped.group(column).having('sum(1) > 1').pluck(column)- instances = table_class.where(column => [nil, attributes])-- instances.find_each do |instance|- column_value = 'Unique String ' + SecureRandom.urlsafe_base64(8).upcase.delete('/+=_-')[0, 8]- instance.send("#{column}=", column_value)- instance.save- end-- remove_index table_name, column if index_exists?(table_name, column)- if supports_expression_index?- add_index table_name, "(lower(#{column}))", unique: true- else- add_index table_name, column, unique: true- end- end- end- end- end-enddiff --git a/core/db/migrate/20170329110859_add_index_on_stock_location_to_spree_customer_returns.rb b/core/db/migrate/20170329110859_add_index_on_stock_location_to_spree_customer_returns.rbdeleted file mode 100644index 79346747dd..0000000000--- a/core/db/migrate/20170329110859_add_index_on_stock_location_to_spree_customer_returns.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexOnStockLocationToSpreeCustomerReturns < ActiveRecord::Migration[5.0]- def change- add_index :spree_customer_returns, :stock_location_id- end-enddiff --git a/core/db/migrate/20170329113917_add_index_on_prototype_to_spree_option_type_prototype.rb b/core/db/migrate/20170329113917_add_index_on_prototype_to_spree_option_type_prototype.rbdeleted file mode 100644index b9f1a5db2b..0000000000--- a/core/db/migrate/20170329113917_add_index_on_prototype_to_spree_option_type_prototype.rb+++ /dev/null@@ -1,19 +0,0 @@-class AddIndexOnPrototypeToSpreeOptionTypePrototype < ActiveRecord::Migration[5.0]- def change- duplicates = Spree::OptionTypePrototype.group(:prototype_id, :option_type_id).having('sum(1) > 1').size-- duplicates.each do |f|- prototype_id, option_type_id = f.first- count = f.last - 1 # we want to leave one record- otp = Spree::OptionTypePrototype.where(prototype_id: prototype_id, option_type_id: option_type_id).last(count)- otp.map(&:destroy)- end-- if index_exists? :spree_option_type_prototypes, [:prototype_id, :option_type_id]- remove_index :spree_option_type_prototypes, [:prototype_id, :option_type_id]- add_index :spree_option_type_prototypes, [:prototype_id, :option_type_id], unique: true, name: 'spree_option_type_prototypes_prototype_id_option_type_id'- end-- add_index :spree_option_type_prototypes, :prototype_id- end-enddiff --git a/core/db/migrate/20170330082155_add_indexes_to_spree_option_value_variant.rb b/core/db/migrate/20170330082155_add_indexes_to_spree_option_value_variant.rbdeleted file mode 100644index 4356af01a6..0000000000--- a/core/db/migrate/20170330082155_add_indexes_to_spree_option_value_variant.rb+++ /dev/null@@ -1,19 +0,0 @@-class AddIndexesToSpreeOptionValueVariant < ActiveRecord::Migration[5.0]- def change- duplicates = Spree::OptionValueVariant.group(:variant_id, :option_value_id).having('sum(1) > 1').size-- duplicates.each do |f|- variant_id, option_value_id = f.first- count = f.last - 1 # we want to leave one record- ov = Spree::OptionValueVariant.where(variant_id: variant_id, option_value_id: option_value_id).last(count)- ov.map(&:destroy)- end-- if index_exists? :spree_option_value_variants, [:variant_id, :option_value_id], name: "index_option_values_variants_on_variant_id_and_option_value_id"- remove_index :spree_option_value_variants, [:variant_id, :option_value_id]- add_index :spree_option_value_variants, [:variant_id, :option_value_id], unique: true, name: "index_option_values_variants_on_variant_id_and_option_value_id"- end-- add_index :spree_option_value_variants, :variant_id- end-enddiff --git a/core/db/migrate/20170330132215_add_index_on_promotion_id_to_order_promotions.rb b/core/db/migrate/20170330132215_add_index_on_promotion_id_to_order_promotions.rbdeleted file mode 100644index b97d69af9d..0000000000--- a/core/db/migrate/20170330132215_add_index_on_promotion_id_to_order_promotions.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexOnPromotionIdToOrderPromotions < ActiveRecord::Migration[5.0]- def change- add_index :spree_order_promotions, :promotion_id- end-enddiff --git a/core/db/migrate/20170331101758_add_indexes_for_property_prototype.rb b/core/db/migrate/20170331101758_add_indexes_for_property_prototype.rbdeleted file mode 100644index 2c6d2f3ef2..0000000000--- a/core/db/migrate/20170331101758_add_indexes_for_property_prototype.rb+++ /dev/null@@ -1,20 +0,0 @@-class AddIndexesForPropertyPrototype < ActiveRecord::Migration[5.0]- def change- duplicates = Spree::PropertyPrototype.group(:prototype_id, :property_id).having('sum(1) > 1').size-- duplicates.each do |f|- prototype_id, property_id = f.first- count = f.last - 1 # we want to leave one record- prototypes = Spree::PropertyPrototype.where(prototype_id: prototype_id, property_id: property_id).last(count)- prototypes.map(&:destroy)- end-- if index_exists? :spree_property_prototypes, [:prototype_id, :property_id]- remove_index :spree_property_prototypes, [:prototype_id, :property_id]- add_index :spree_property_prototypes, [:prototype_id, :property_id], unique: true, name: 'index_property_prototypes_on_prototype_id_and_property_id'- end-- add_index :spree_property_prototypes, :prototype_id- add_index :spree_property_prototypes, :property_id- end-enddiff --git a/core/db/migrate/20170331103334_add_index_for_prototype_id_to_prototype_taxons.rb b/core/db/migrate/20170331103334_add_index_for_prototype_id_to_prototype_taxons.rbdeleted file mode 100644index a0c8621411..0000000000--- a/core/db/migrate/20170331103334_add_index_for_prototype_id_to_prototype_taxons.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexForPrototypeIdToPrototypeTaxons < ActiveRecord::Migration[5.0]- def change- add_index :spree_prototype_taxons, :prototype_id- end-enddiff --git a/core/db/migrate/20170331110454_add_indexes_to_refunds.rb b/core/db/migrate/20170331110454_add_indexes_to_refunds.rbdeleted file mode 100644index d3d73687ef..0000000000--- a/core/db/migrate/20170331110454_add_indexes_to_refunds.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddIndexesToRefunds < ActiveRecord::Migration[5.0]- def change- add_index :spree_refunds, :payment_id- add_index :spree_refunds, :reimbursement_id- end-enddiff --git a/core/db/migrate/20170331111757_add_indexes_to_reimbursement_credits.rb b/core/db/migrate/20170331111757_add_indexes_to_reimbursement_credits.rbdeleted file mode 100644index fdc9ae205e..0000000000--- a/core/db/migrate/20170331111757_add_indexes_to_reimbursement_credits.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddIndexesToReimbursementCredits < ActiveRecord::Migration[5.0]- def change- add_index :spree_reimbursement_credits, :reimbursement_id- add_index :spree_reimbursement_credits, [:creditable_id, :creditable_type], name: 'index_reimbursement_credits_on_creditable_id_and_type'- end-enddiff --git a/core/db/migrate/20170331115246_add_indexes_to_return_authorizations.rb b/core/db/migrate/20170331115246_add_indexes_to_return_authorizations.rbdeleted file mode 100644index 0764f7b349..0000000000--- a/core/db/migrate/20170331115246_add_indexes_to_return_authorizations.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddIndexesToReturnAuthorizations < ActiveRecord::Migration[5.0]- def change- add_index :spree_return_authorizations, :order_id- add_index :spree_return_authorizations, :stock_location_id- end-enddiff --git a/core/db/migrate/20170331120125_add_indexes_to_return_items.rb b/core/db/migrate/20170331120125_add_indexes_to_return_items.rbdeleted file mode 100644index 449bbd20ed..0000000000--- a/core/db/migrate/20170331120125_add_indexes_to_return_items.rb+++ /dev/null@@ -1,11 +0,0 @@-class AddIndexesToReturnItems < ActiveRecord::Migration[5.0]- def change- add_index :spree_return_items, :return_authorization_id- add_index :spree_return_items, :inventory_unit_id- add_index :spree_return_items, :reimbursement_id- add_index :spree_return_items, :exchange_variant_id- add_index :spree_return_items, :preferred_reimbursement_type_id- add_index :spree_return_items, :override_reimbursement_type_id- end-end-diff --git a/core/db/migrate/20170331121725_add_index_to_role_users.rb b/core/db/migrate/20170331121725_add_index_to_role_users.rbdeleted file mode 100644index 145e2f90c7..0000000000--- a/core/db/migrate/20170331121725_add_index_to_role_users.rb+++ /dev/null@@ -1,18 +0,0 @@-class AddIndexToRoleUsers < ActiveRecord::Migration[5.0]- def change-- duplicates = Spree::RoleUser.group(:role_id, :user_id).having('sum(1) > 1').size-- duplicates.each do |f|- role_id, user_id = f.first- count = f.last - 1 # we want to leave one record- roles = Spree::RoleUser.where(role_id: role_id, user_id: user_id).last(count)- roles.map(&:destroy)- end-- if index_exists? :spree_role_users, [:role_id, :user_id]- remove_index :spree_role_users, [:role_id, :user_id]- add_index :spree_role_users, [:role_id, :user_id], unique: true- end- end-enddiff --git a/core/db/migrate/20170331123625_add_index_to_shipping_method_categories.rb b/core/db/migrate/20170331123625_add_index_to_shipping_method_categories.rbdeleted file mode 100644index 5dbfb52d6d..0000000000--- a/core/db/migrate/20170331123625_add_index_to_shipping_method_categories.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexToShippingMethodCategories < ActiveRecord::Migration[5.0]- def change- add_index :spree_shipping_method_categories, :shipping_category_id- end-enddiff --git a/core/db/migrate/20170331123832_add_index_to_shipping_method_zones.rb b/core/db/migrate/20170331123832_add_index_to_shipping_method_zones.rbdeleted file mode 100644index 6d2e193485..0000000000--- a/core/db/migrate/20170331123832_add_index_to_shipping_method_zones.rb+++ /dev/null@@ -1,20 +0,0 @@-class AddIndexToShippingMethodZones < ActiveRecord::Migration[5.0]- def change- duplicates = Spree::ShippingMethodZone.group(:shipping_method_id, :zone_id).having('sum(1) > 1').size-- duplicates.each do |f|- shipping_method_id, zone_id = f.first- count = f.last - 1 # we want to leave one record- zones = Spree::ShippingMethodZone.where(shipping_method_id: shipping_method_id, zone_id: zone_id).last(count)- zones.map(&:destroy)- end-- if index_exists? :spree_shipping_method_zones, [:shipping_method_id, :zone_id]- remove_index :spree_shipping_method_zones, [:shipping_method_id, :zone_id]- add_index :spree_shipping_method_zones, [:shipping_method_id, :zone_id], unique: true- end-- add_index :spree_shipping_method_zones, :zone_id- add_index :spree_shipping_method_zones, :shipping_method_id- end-enddiff --git a/core/db/migrate/20170331124251_add_index_to_spree_shipping_rates.rb b/core/db/migrate/20170331124251_add_index_to_spree_shipping_rates.rbdeleted file mode 100644index 5717203f83..0000000000--- a/core/db/migrate/20170331124251_add_index_to_spree_shipping_rates.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddIndexToSpreeShippingRates < ActiveRecord::Migration[5.0]- def change- add_index :spree_shipping_rates, :shipment_id- add_index :spree_shipping_rates, :shipping_method_id- end-enddiff --git a/core/db/migrate/20170331124513_add_index_to_spree_stock_items.rb b/core/db/migrate/20170331124513_add_index_to_spree_stock_items.rbdeleted file mode 100644index 498601ba1d..0000000000--- a/core/db/migrate/20170331124513_add_index_to_spree_stock_items.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexToSpreeStockItems < ActiveRecord::Migration[5.0]- def change- add_index :spree_stock_items, :stock_location_id- end-enddiff --git a/core/db/migrate/20170331124924_add_index_to_spree_stock_movement.rb b/core/db/migrate/20170331124924_add_index_to_spree_stock_movement.rbdeleted file mode 100644index 94403bed86..0000000000--- a/core/db/migrate/20170331124924_add_index_to_spree_stock_movement.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddIndexToSpreeStockMovement < ActiveRecord::Migration[5.0]- def change- add_index :spree_stock_movements, [:originator_id, :originator_type], name: 'index_stock_movements_on_originator_id_and_originator_type'- end-enddiff --git a/core/db/migrate/20170413211707_change_indexes_on_friendly_id_slugs.rb b/core/db/migrate/20170413211707_change_indexes_on_friendly_id_slugs.rbdeleted file mode 100644index c100929de5..0000000000--- a/core/db/migrate/20170413211707_change_indexes_on_friendly_id_slugs.rb+++ /dev/null@@ -1,10 +0,0 @@-class ChangeIndexesOnFriendlyIdSlugs < ActiveRecord::Migration[5.0]- def change- # Updating indexes to reflect changes in friendly_id v5.2- # See: https://github.com/norman/friendly_id/pull/694/commits/9f107f07ec9d2a58bda5a712b6e79a8d8013e0ab- remove_index :friendly_id_slugs, [:slug, :sluggable_type]- remove_index :friendly_id_slugs, [:slug, :sluggable_type, :scope]- add_index :friendly_id_slugs, [:slug, :sluggable_type], length: { name: 100, slug: 20, sluggable_type: 20 }- add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], length: { name: 100, slug: 20, sluggable_type: 20, scope: 20 }, unique: true- end-enddiff --git a/core/db/migrate/20170722102643_add_analytics_kind_to_spree_trackers.rb b/core/db/migrate/20170722102643_add_analytics_kind_to_spree_trackers.rbdeleted file mode 100644index 7216a53560..0000000000--- a/core/db/migrate/20170722102643_add_analytics_kind_to_spree_trackers.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddAnalyticsKindToSpreeTrackers < ActiveRecord::Migration[5.1]- def change- add_column :spree_trackers, :kind, :integer, default: 0, null: false, index: true- end-enddiff --git a/core/db/migrate/20170727103056_rename_tracker_kind_field.rb b/core/db/migrate/20170727103056_rename_tracker_kind_field.rbdeleted file mode 100644index b4a438239b..0000000000--- a/core/db/migrate/20170727103056_rename_tracker_kind_field.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameTrackerKindField < ActiveRecord::Migration[5.1]- def change- rename_column :spree_trackers, :kind, :engine- end-enddiff --git a/core/db/migrate/20171004223836_remove_icon_from_taxons.rb b/core/db/migrate/20171004223836_remove_icon_from_taxons.rbdeleted file mode 100644index 2813be2cc7..0000000000--- a/core/db/migrate/20171004223836_remove_icon_from_taxons.rb+++ /dev/null@@ -1,8 +0,0 @@-class RemoveIconFromTaxons < ActiveRecord::Migration[5.1]- def change- remove_column :spree_taxons, :icon_file_name if column_exists? :spree_taxons, :icon_file_name- remove_column :spree_taxons, :icon_content_type if column_exists? :spree_taxons, :icon_content_type- remove_column :spree_taxons, :icon_file_size if column_exists? :spree_taxons, :icon_file_size- remove_column :spree_taxons, :icon_updated_at if column_exists? :spree_taxons, :icon_updated_at- end-enddiff --git a/core/db/migrate/20180222133746_add_unique_index_on_spree_promotions_code.rb b/core/db/migrate/20180222133746_add_unique_index_on_spree_promotions_code.rbdeleted file mode 100644index 787c2c1cdc..0000000000--- a/core/db/migrate/20180222133746_add_unique_index_on_spree_promotions_code.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddUniqueIndexOnSpreePromotionsCode < ActiveRecord::Migration[5.1]- def change- remove_index :spree_promotions, :code- add_index :spree_promotions, :code, unique: true- end-enddiff --git a/core/db/migrate/20180613080857_rename_guest_token_to_token_in_orders.rb b/core/db/migrate/20180613080857_rename_guest_token_to_token_in_orders.rbdeleted file mode 100644index 1a0b96984b..0000000000--- a/core/db/migrate/20180613080857_rename_guest_token_to_token_in_orders.rb+++ /dev/null@@ -1,5 +0,0 @@-class RenameGuestTokenToTokenInOrders < ActiveRecord::Migration[5.2]- def change- rename_column :spree_orders, :guest_token, :token- end-enddiff --git a/core/db/migrate/20180915160001_add_timestamps_to_spree_prices.rb b/core/db/migrate/20180915160001_add_timestamps_to_spree_prices.rbdeleted file mode 100644index 3e02aa60ae..0000000000--- a/core/db/migrate/20180915160001_add_timestamps_to_spree_prices.rb+++ /dev/null@@ -1,12 +0,0 @@-class AddTimestampsToSpreePrices < ActiveRecord::Migration[5.2]- def up- add_timestamps :spree_prices, default: Time.current- change_column_default :spree_prices, :created_at, nil- change_column_default :spree_prices, :updated_at, nil- end-- def down- remove_column :spree_prices, :created_at- remove_column :spree_prices, :updated_at- end-enddiff --git a/core/db/migrate/20181024100754_add_deleted_at_to_spree_credit_cards.rb b/core/db/migrate/20181024100754_add_deleted_at_to_spree_credit_cards.rbdeleted file mode 100644index 3814f7323d..0000000000--- a/core/db/migrate/20181024100754_add_deleted_at_to_spree_credit_cards.rb+++ /dev/null@@ -1,6 +0,0 @@-class AddDeletedAtToSpreeCreditCards < ActiveRecord::Migration[5.2]- def change- add_column :spree_credit_cards, :deleted_at, :datetime- add_index :spree_credit_cards, :deleted_at- end-enddiff --git a/core/db/migrate/20190305121659_add_iso_and_iso3_validation_on_presence_and_uniqueness.rb b/core/db/migrate/20190305121659_add_iso_and_iso3_validation_on_presence_and_uniqueness.rbdeleted file mode 100644index 4944b55737..0000000000--- a/core/db/migrate/20190305121659_add_iso_and_iso3_validation_on_presence_and_uniqueness.rb+++ /dev/null@@ -1,18 +0,0 @@-class AddIsoAndIso3ValidationOnPresenceAndUniqueness < ActiveRecord::Migration[5.2]- def up- Spree::Country.where.not(id: Spree::Country.group(:iso).select("min(id)")).destroy_all- Spree::Country.where.not(id: Spree::Country.group(:iso3).select("min(id)")).destroy_all-- change_column_null(:spree_countries, :iso, false)- change_column_null(:spree_countries, :iso3, false)- add_index :spree_countries, :iso, unique: true- add_index :spree_countries, :iso3, unique: true- end-- def down- change_column_null(:spree_countries, :iso, true)- change_column_null(:spree_countries, :iso3, true)- remove_index :spree_countries, :iso, unique: true- remove_index :spree_countries, :iso3, unique: true- end-enddiff --git a/core/db/migrate/20190523092729_add_user_id_and_deleted_at_to_spree_addresses.rb b/core/db/migrate/20190523092729_add_user_id_and_deleted_at_to_spree_addresses.rbdeleted file mode 100644index b01103176b..0000000000--- a/core/db/migrate/20190523092729_add_user_id_and_deleted_at_to_spree_addresses.rb+++ /dev/null@@ -1,12 +0,0 @@-# this migration does the same as this two from SpreeAddressBook-# https://github.com/spree-contrib/spree_address_book/blob/master/db/migrate/20110302102208_add_user_id_and_deleted_at_to_addresses.rb-# https://github.com/spree-contrib/spree_address_book/blob/master/db/migrate/20170405133031_add_missing_indexes.rb-class AddUserIdAndDeletedAtToSpreeAddresses < ActiveRecord::Migration[5.2]- def change- add_column :spree_addresses, :user_id, :integer unless column_exists?(:spree_addresses, :user_id)- add_index :spree_addresses, :user_id unless index_exists?(:spree_addresses, :user_id)-- add_column :spree_addresses, :deleted_at, :datetime unless column_exists?(:spree_addresses, :deleted_at)- add_index :spree_addresses, :deleted_at unless index_exists?(:spree_addresses, :deleted_at)- end-enddiff --git a/core/db/migrate/20191005121504_add_store_id_to_payment_methods.rb b/core/db/migrate/20191005121504_add_store_id_to_payment_methods.rbdeleted file mode 100644index 59b3c1f63a..0000000000--- a/core/db/migrate/20191005121504_add_store_id_to_payment_methods.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddStoreIdToPaymentMethods < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_payment_methods, :store_id)- add_reference :spree_payment_methods, :store, references: :spree_stores, index: true- end- end-enddiff --git a/core/db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb b/core/db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rbdeleted file mode 100644index f5066c4389..0000000000--- a/core/db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddDeafultValueForStoreDefaultCurrency < ActiveRecord::Migration[5.2]- def change- Spree::Store.where(default_currency: nil).update_all(default_currency: Spree::Config[:currency])- end-enddiff --git a/core/db/migrate/20191017121054_add_supported_currencies_to_store.rb b/core/db/migrate/20191017121054_add_supported_currencies_to_store.rbdeleted file mode 100644index f9ecc1a575..0000000000--- a/core/db/migrate/20191017121054_add_supported_currencies_to_store.rb+++ /dev/null@@ -1,11 +0,0 @@-class AddSupportedCurrenciesToStore < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_stores, :supported_currencies)- add_column :spree_stores, :supported_currencies, :string- Spree::Store.reset_column_information- Spree::Store.all.each do |store|- store.update_attribute(:supported_currencies, store.default_currency)- end- end- end-enddiff --git a/core/db/migrate/20200102141311_add_social_to_spree_stores.rb b/core/db/migrate/20200102141311_add_social_to_spree_stores.rbdeleted file mode 100644index bb6f149bda..0000000000--- a/core/db/migrate/20200102141311_add_social_to_spree_stores.rb+++ /dev/null@@ -1,10 +0,0 @@-class AddSocialToSpreeStores < ActiveRecord::Migration[5.2]- def change- add_column :spree_stores, :facebook, :string- add_column :spree_stores, :twitter, :string- add_column :spree_stores, :instagram, :string-- # Fix cache issue #10381- Rails.cache.delete('default_store')- end-enddiff --git a/core/db/migrate/20200212144523_add_hide_from_nav_to_taxons.rb b/core/db/migrate/20200212144523_add_hide_from_nav_to_taxons.rbdeleted file mode 100644index 4c9f818eb2..0000000000--- a/core/db/migrate/20200212144523_add_hide_from_nav_to_taxons.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddHideFromNavToTaxons < ActiveRecord::Migration[5.2]- def change- add_column :spree_taxons, :hide_from_nav, :boolean, default: false, index: true- end-enddiff --git a/core/db/migrate/20200308210757_add_default_locale_to_spree_store.rb b/core/db/migrate/20200308210757_add_default_locale_to_spree_store.rbdeleted file mode 100644index 14b2c2aecb..0000000000--- a/core/db/migrate/20200308210757_add_default_locale_to_spree_store.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddDefaultLocaleToSpreeStore < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_stores, :default_locale)- add_column :spree_stores, :default_locale, :string- end- end-enddiff --git a/core/db/migrate/20200310145140_add_customer_support_email_to_spree_store.rb b/core/db/migrate/20200310145140_add_customer_support_email_to_spree_store.rbdeleted file mode 100644index 4d0abfd8ee..0000000000--- a/core/db/migrate/20200310145140_add_customer_support_email_to_spree_store.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddCustomerSupportEmailToSpreeStore < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_stores, :customer_support_email)- add_column :spree_stores, :customer_support_email, :string- end- end-enddiff --git a/core/db/migrate/20200421095017_add_compare_at_amount_to_spree_prices.rb b/core/db/migrate/20200421095017_add_compare_at_amount_to_spree_prices.rbdeleted file mode 100644index de98207ac6..0000000000--- a/core/db/migrate/20200421095017_add_compare_at_amount_to_spree_prices.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddCompareAtAmountToSpreePrices < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_prices, :compare_at_amount)- add_column :spree_prices, :compare_at_amount, :decimal, precision: 10, scale: 2- end- end-enddiff --git a/core/db/migrate/20200423123001_add_default_country_id_to_spree_store.rb b/core/db/migrate/20200423123001_add_default_country_id_to_spree_store.rbdeleted file mode 100644index fa7139a6be..0000000000--- a/core/db/migrate/20200423123001_add_default_country_id_to_spree_store.rb+++ /dev/null@@ -1,9 +0,0 @@-class AddDefaultCountryIdToSpreeStore < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_stores, :default_country_id)- add_column :spree_stores, :default_country_id, :integer- Spree::Store.reset_column_information- Spree::Store.update_all(default_country_id: Spree::Config[:default_country_id])- end- end-enddiff --git a/core/db/migrate/20200430072209_add_footer_fields_to_spree_stores.rb b/core/db/migrate/20200430072209_add_footer_fields_to_spree_stores.rbdeleted file mode 100644index 0f0238d39b..0000000000--- a/core/db/migrate/20200430072209_add_footer_fields_to_spree_stores.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddFooterFieldsToSpreeStores < ActiveRecord::Migration[5.2]- def change- add_column :spree_stores, :description, :text unless column_exists?(:spree_stores, :description)- add_column :spree_stores, :address, :text unless column_exists?(:spree_stores, :address)- add_column :spree_stores, :contact_phone, :string unless column_exists?(:spree_stores, :contact_phone)- add_column :spree_stores, :contact_email, :string unless column_exists?(:spree_stores, :contact_email)- end-enddiff --git a/core/db/migrate/20200513154939_add_show_property_to_spree_product_properties.rb b/core/db/migrate/20200513154939_add_show_property_to_spree_product_properties.rbdeleted file mode 100644index aab8f35999..0000000000--- a/core/db/migrate/20200513154939_add_show_property_to_spree_product_properties.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddShowPropertyToSpreeProductProperties < ActiveRecord::Migration[5.2]- def change- add_column :spree_product_properties, :show_property, :boolean, default: true unless column_exists?(:spree_product_properties, :show_property)- end-enddiff --git a/core/db/migrate/20200607161221_add_store_owner_order_notification_delivered_to_spree_orders.rb b/core/db/migrate/20200607161221_add_store_owner_order_notification_delivered_to_spree_orders.rbdeleted file mode 100644index 655b533742..0000000000--- a/core/db/migrate/20200607161221_add_store_owner_order_notification_delivered_to_spree_orders.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddStoreOwnerOrderNotificationDeliveredToSpreeOrders < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_orders, :store_owner_notification_delivered)- add_column :spree_orders, :store_owner_notification_delivered, :boolean- end- end-enddiff --git a/core/db/migrate/20200607161222_add_new_order_notifications_email_to_spree_stores.rb b/core/db/migrate/20200607161222_add_new_order_notifications_email_to_spree_stores.rbdeleted file mode 100644index 2d71f9625e..0000000000--- a/core/db/migrate/20200607161222_add_new_order_notifications_email_to_spree_stores.rb+++ /dev/null@@ -1,7 +0,0 @@-class AddNewOrderNotificationsEmailToSpreeStores < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_stores, :new_order_notifications_email)- add_column :spree_stores, :new_order_notifications_email, :string- end- end-enddiff --git a/core/db/migrate/20200610113542_add_label_to_spree_addresses.rb b/core/db/migrate/20200610113542_add_label_to_spree_addresses.rbdeleted file mode 100644index 5b2a6c07dd..0000000000--- a/core/db/migrate/20200610113542_add_label_to_spree_addresses.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddLabelToSpreeAddresses < ActiveRecord::Migration[5.2]- def change- add_column :spree_addresses, :label, :string unless column_exists?(:spree_addresses, :label)- end-enddiff --git a/core/db/migrate/20200826075557_add_unique_index_on_taxon_id_and_product_id_to_spree_products_taxons.rb b/core/db/migrate/20200826075557_add_unique_index_on_taxon_id_and_product_id_to_spree_products_taxons.rbdeleted file mode 100644index 4e71ece82e..0000000000--- a/core/db/migrate/20200826075557_add_unique_index_on_taxon_id_and_product_id_to_spree_products_taxons.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddUniqueIndexOnTaxonIdAndProductIdToSpreeProductsTaxons < ActiveRecord::Migration[5.2]- def change- add_index :spree_products_taxons, [:product_id, :taxon_id], unique: true unless index_exists? :spree_products_taxons, [:product_id, :taxon_id]- end-enddiff --git a/core/db/migrate/20201006110150_add_checkout_zone_field_to_store.rb b/core/db/migrate/20201006110150_add_checkout_zone_field_to_store.rbdeleted file mode 100644index 3c005377fe..0000000000--- a/core/db/migrate/20201006110150_add_checkout_zone_field_to_store.rb+++ /dev/null@@ -1,12 +0,0 @@-class AddCheckoutZoneFieldToStore < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_stores, :checkout_zone_id)- add_column :spree_stores, :checkout_zone_id, :integer-- Spree::Store.reset_column_information-- default_zone = Spree::Zone.default_checkout_zone- Spree::Store.update_all(checkout_zone_id: default_zone.id) if default_zone.present?- end- end-enddiff --git a/core/db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rb b/core/db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rbdeleted file mode 100644index 7d3f7eba5f..0000000000--- a/core/db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rb+++ /dev/null@@ -1,10 +0,0 @@-class AddFilterableColumnToSpreeOptionTypes < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_option_types, :filterable)- add_column :spree_option_types, :filterable, :boolean, default: true, null: false- end- unless index_exists?(:spree_option_types, :filterable)- add_index :spree_option_types, :filterable- end- end-enddiff --git a/core/db/migrate/20201013084504_add_seo_robots_to_spree_stores.rb b/core/db/migrate/20201013084504_add_seo_robots_to_spree_stores.rbdeleted file mode 100644index 6de836f3bc..0000000000--- a/core/db/migrate/20201013084504_add_seo_robots_to_spree_stores.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddSeoRobotsToSpreeStores < ActiveRecord::Migration[5.2]- def change- add_column :spree_stores, :seo_robots, :string unless column_exists?(:spree_stores, :seo_robots)- end-enddiff --git a/core/db/migrate/20201023152810_add_filterable_to_spree_properties.rb b/core/db/migrate/20201023152810_add_filterable_to_spree_properties.rbdeleted file mode 100644index 7de175b979..0000000000--- a/core/db/migrate/20201023152810_add_filterable_to_spree_properties.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddFilterableToSpreeProperties < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_properties, :filterable)- add_column :spree_properties, :filterable, :boolean, default: false, null: false- add_index :spree_properties, :filterable- end- end-enddiff --git a/core/db/migrate/20201127084048_add_default_country_kind_to_spree_zones.rb b/core/db/migrate/20201127084048_add_default_country_kind_to_spree_zones.rbdeleted file mode 100644index 3dfc820ac8..0000000000--- a/core/db/migrate/20201127084048_add_default_country_kind_to_spree_zones.rb+++ /dev/null@@ -1,5 +0,0 @@-class AddDefaultCountryKindToSpreeZones < ActiveRecord::Migration[5.2]- def change- change_column_default(:spree_zones, :kind, :state)- end-enddiff --git a/core/db/migrate/20210112193440_remove_contact_email_from_spree_stores.rb b/core/db/migrate/20210112193440_remove_contact_email_from_spree_stores.rbdeleted file mode 100644index 1d67dcf1af..0000000000--- a/core/db/migrate/20210112193440_remove_contact_email_from_spree_stores.rb+++ /dev/null@@ -1,5 +0,0 @@-class RemoveContactEmailFromSpreeStores < ActiveRecord::Migration[5.2]- def change- remove_column :spree_stores, :contact_email- end-enddiff --git a/core/db/migrate/20210114182625_create_spree_payment_methods_stores.rb b/core/db/migrate/20210114182625_create_spree_payment_methods_stores.rbdeleted file mode 100644index 8dcc9bc381..0000000000--- a/core/db/migrate/20210114182625_create_spree_payment_methods_stores.rb+++ /dev/null@@ -1,10 +0,0 @@-class CreateSpreePaymentMethodsStores < ActiveRecord::Migration[5.2]- def change- create_table :spree_payment_methods_stores, id: false do |t|- t.belongs_to :payment_method- t.belongs_to :store- end-- add_index :spree_payment_methods_stores, [:payment_method_id, :store_id], unique: true, name: 'payment_mentod_id_store_id_unique_index'- end-enddiff --git a/core/db/migrate/20210114220232_migrate_data_payment_methods_stores.rb b/core/db/migrate/20210114220232_migrate_data_payment_methods_stores.rbdeleted file mode 100644index 6f2fec6aae..0000000000--- a/core/db/migrate/20210114220232_migrate_data_payment_methods_stores.rb+++ /dev/null@@ -1,15 +0,0 @@-class MigrateDataPaymentMethodsStores < ActiveRecord::Migration[5.2]- def up- Spree::PaymentMethod.all.each do |payment_method|- next if payment_method.store_ids.any?-- if payment_method[:store_id].present?- payment_method.store_ids = payment_method[:store_id]- else- payment_method.store_ids = Spree::Store.ids- end-- payment_method.save- end- end-enddiff --git a/core/db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rb b/core/db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rbdeleted file mode 100644index 7ee51e93b2..0000000000--- a/core/db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rb+++ /dev/null@@ -1,5 +0,0 @@-class RemoveStoreIdFromSpreePaymentMethods < ActiveRecord::Migration[5.2]- def change- remove_column :spree_payment_methods, :store_id, :integer- end-enddiff --git a/core/db/migrate/20210120142527_ensure_default_locale_in_spree_stores.rb b/core/db/migrate/20210120142527_ensure_default_locale_in_spree_stores.rbdeleted file mode 100644index f3cb766220..0000000000--- a/core/db/migrate/20210120142527_ensure_default_locale_in_spree_stores.rb+++ /dev/null@@ -1,5 +0,0 @@-class EnsureDefaultLocaleInSpreeStores < ActiveRecord::Migration[5.2]- def change- Spree::Store.where(default_locale: nil).update_all(default_locale: I18n.locale)- end-enddiff --git a/core/db/migrate/20210205211040_add_supported_locales_to_spree_stores.rb b/core/db/migrate/20210205211040_add_supported_locales_to_spree_stores.rbdeleted file mode 100644index 4418be91d4..0000000000--- a/core/db/migrate/20210205211040_add_supported_locales_to_spree_stores.rb+++ /dev/null@@ -1,11 +0,0 @@-class AddSupportedLocalesToSpreeStores < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_stores, :supported_locales)- add_column :spree_stores, :supported_locales, :string- Spree::Store.reset_column_information- Spree::Store.all.each do |store|- store.update_attribute(:supported_locales, store.default_locale)- end- end- end-enddiff --git a/core/db/migrate/20210215202602_migrate_spree_i18n_globalize_config.rb b/core/db/migrate/20210215202602_migrate_spree_i18n_globalize_config.rbdeleted file mode 100644index 84a2909892..0000000000--- a/core/db/migrate/20210215202602_migrate_spree_i18n_globalize_config.rb+++ /dev/null@@ -1,22 +0,0 @@-class MigrateSpreeI18nGlobalizeConfig < ActiveRecord::Migration[5.2]- def up- locales = []-- if defined?(SpreeI18n) && defined?(SpreeI18n::Config)- locales = (locales << SpreeI18n::Config[:available_locales]).flatten.uniq.compact- end-- if defined?(SpreeGlobalize) && defined?(SpreeGlobalize::Config)- locales = (locales << SpreeGlobalize::Config[:supported_locales]).flatten.uniq.compact- end-- default_store = Spree::Store.default- if default_store.supported_locales.blank? || default_store.supported_locales == default_store.default_locale- locales = (locales << default_store.default_locale).uniq.compact.join(',')- default_store.update(supported_locales: locales)- end- end-- def down- end-enddiff --git a/core/db/migrate/20210407200948_create_spree_menus.rb b/core/db/migrate/20210407200948_create_spree_menus.rbdeleted file mode 100644index 92a5984ba9..0000000000--- a/core/db/migrate/20210407200948_create_spree_menus.rb+++ /dev/null@@ -1,16 +0,0 @@-class CreateSpreeMenus < ActiveRecord::Migration[5.2]- def change- create_table :spree_menus do |t|- t.column :name, :string- t.column :location, :string- t.column :locale, :string-- t.belongs_to :store-- t.timestamps- end-- add_index :spree_menus, :locale- add_index :spree_menus, [:store_id, :location, :locale], unique: true- end-enddiff --git a/core/db/migrate/20210408092939_create_spree_menu_items.rb b/core/db/migrate/20210408092939_create_spree_menu_items.rbdeleted file mode 100644index d270838c8c..0000000000--- a/core/db/migrate/20210408092939_create_spree_menu_items.rb+++ /dev/null@@ -1,31 +0,0 @@-class CreateSpreeMenuItems < ActiveRecord::Migration[5.2]- def change- create_table :spree_menu_items do |t|- t.column :name, :string, null: false- t.column :subtitle, :string- t.column :destination, :string- t.column :new_window, :boolean, default: false- t.column :item_type, :string- t.column :linked_resource_type, :string, default: 'URL'- t.column :linked_resource_id, :integer- t.column :code, :string-- t.column :parent_id, :integer- t.column :lft, :integer, null: false- t.column :rgt, :integer, null: false- t.column :depth, :integer, null: false, default: 0-- t.belongs_to :menu-- t.timestamps- end-- add_index :spree_menu_items, :lft- add_index :spree_menu_items, :rgt- add_index :spree_menu_items, :depth- add_index :spree_menu_items, :parent_id- add_index :spree_menu_items, :item_type- add_index :spree_menu_items, :code- add_index :spree_menu_items, [:linked_resource_type, :linked_resource_id], name: 'index_spree_menu_items_on_linked_resource'- end-enddiff --git a/core/db/migrate/20210504163720_add_filter_param_to_spree_product_properties.rb b/core/db/migrate/20210504163720_add_filter_param_to_spree_product_properties.rbdeleted file mode 100644index 1e154a4993..0000000000--- a/core/db/migrate/20210504163720_add_filter_param_to_spree_product_properties.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddFilterParamToSpreeProductProperties < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_product_properties, :filter_param)- add_column :spree_product_properties, :filter_param, :string- add_index :spree_product_properties, :filter_param- end- end-enddiff --git a/core/db/migrate/20210505114659_add_filter_param_to_spree_properties.rb b/core/db/migrate/20210505114659_add_filter_param_to_spree_properties.rbdeleted file mode 100644index 5dc45ee40e..0000000000--- a/core/db/migrate/20210505114659_add_filter_param_to_spree_properties.rb+++ /dev/null@@ -1,8 +0,0 @@-class AddFilterParamToSpreeProperties < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_properties, :filter_param)- add_column :spree_properties, :filter_param, :string- add_index :spree_properties, :filter_param- end- end-enddiff --git a/core/db/migrate/20210512191732_create_spree_cms_pages.rb b/core/db/migrate/20210512191732_create_spree_cms_pages.rbdeleted file mode 100644index 90c101dc09..0000000000--- a/core/db/migrate/20210512191732_create_spree_cms_pages.rb+++ /dev/null@@ -1,24 +0,0 @@-class CreateSpreeCmsPages < ActiveRecord::Migration[5.2]- def change- create_table :spree_cms_pages do |t|- t.column :title, :string, null: false- t.column :meta_title, :string- t.column :content, :text- t.column :meta_description, :text- t.column :visible, :boolean, default: true, index: true- t.column :slug, :string- t.column :type, :string- t.column :locale, :string- t.column :deleted_at, :datetime, index: true-- t.belongs_to :store-- t.timestamps- end-- add_index :spree_cms_pages, [:slug, :store_id], unique: true- add_index :spree_cms_pages, [:slug, :store_id, :deleted_at]- add_index :spree_cms_pages, [:title, :type, :store_id]- add_index :spree_cms_pages, [:store_id, :locale, :type]- end-enddiff --git a/core/db/migrate/20210514204251_create_spree_cms_sections.rb b/core/db/migrate/20210514204251_create_spree_cms_sections.rbdeleted file mode 100644index 93c09caaf3..0000000000--- a/core/db/migrate/20210514204251_create_spree_cms_sections.rb+++ /dev/null@@ -1,22 +0,0 @@-class CreateSpreeCmsSections < ActiveRecord::Migration[5.2]- def change- create_table :spree_cms_sections do |t|- t.column :name, :string, null: false- t.column :content, :text- t.column :settings, :text- t.column :fit, :string- t.column :destination, :string- t.column :type, :string- t.column :position, :integer-- t.references :linked_resource, polymorphic: true, index: { name: 'index_spree_cms_sections_on_linked_resource' }-- t.belongs_to :cms_page-- t.timestamps- end-- add_index :spree_cms_sections, :type- add_index :spree_cms_sections, :position- end-enddiff --git a/core/db/migrate/20210527094055_create_spree_products_stores.rb b/core/db/migrate/20210527094055_create_spree_products_stores.rbdeleted file mode 100644index 0e60e01358..0000000000--- a/core/db/migrate/20210527094055_create_spree_products_stores.rb+++ /dev/null@@ -1,36 +0,0 @@-class CreateSpreeProductsStores < ActiveRecord::Migration[5.2]- def up- if table_exists?(:spree_products_stores)- unless index_exists?(:spree_products_stores, [:product_id, :store_id], unique: true)- add_index :spree_products_stores, [:product_id, :store_id], unique: true- end- unless column_exists?(:spree_products_stores, :created_at)- add_timestamps :spree_products_stores- end- else- create_table :spree_products_stores do |t|- t.references :product, index: true- t.references :store, index: true- t.timestamps-- t.index [:product_id, :store_id], unique: true- end-- stores = Spree::Store.all- product_ids = Spree::Product.with_deleted.order(:id).ids-- if product_ids.any? && Spree::StoreProduct.respond_to?(:insert_all)- stores.find_each do |store|- records = product_ids.map { |product_id| { product_id: product_id, store_id: store.id } }-- # Rails 5 does not have insert_all- Spree::StoreProduct.insert_all(records)- end- end- end- end-- def down- drop_table :spree_products_stores- end-enddiff --git a/core/db/migrate/20210608045519_ensure_store_default_country_is_set.rb b/core/db/migrate/20210608045519_ensure_store_default_country_is_set.rbdeleted file mode 100644index 22e7771faf..0000000000--- a/core/db/migrate/20210608045519_ensure_store_default_country_is_set.rb+++ /dev/null@@ -1,14 +0,0 @@-class EnsureStoreDefaultCountryIsSet < ActiveRecord::Migration[5.2]- def change- # workaround for missing deleted_at column added in later migrations- unless Spree::Store.column_names.include?('deleted_at')- ActiveRecord::Validations::UniquenessParanoiaValidator.module_eval do- def build_relation(klass, *args)- super- end- end- end-- Spree::Store.find_each(&:save)- end-enddiff --git a/core/db/migrate/20210702112334_add_missing_timestamp_columns.rb b/core/db/migrate/20210702112334_add_missing_timestamp_columns.rbdeleted file mode 100644index 5ed06fddb6..0000000000--- a/core/db/migrate/20210702112334_add_missing_timestamp_columns.rb+++ /dev/null@@ -1,46 +0,0 @@-class AddMissingTimestampColumns < ActiveRecord::Migration[5.2]- def change- # Add missing created_at columns- %i[- spree_countries- spree_option_type_prototypes- spree_option_value_variants- spree_order_promotions- spree_product_promotion_rules- spree_products_taxons- spree_promotion_action_line_items- spree_promotion_actions- spree_promotion_rule_taxons- spree_promotion_rule_users- spree_property_prototypes- spree_prototype_taxons- spree_reimbursement_credits- spree_role_users- spree_roles- spree_shipping_method_zones- spree_states- ].each do |table|- add_column table, :created_at, :datetime unless column_exists?(table, :created_at)- end- # Add missing updated_at columns- %i[- spree_option_type_prototypes- spree_option_value_variants- spree_order_promotions- spree_product_promotion_rules- spree_products_taxons- spree_promotion_action_line_items- spree_promotion_actions- spree_promotion_rule_taxons- spree_promotion_rule_users- spree_property_prototypes- spree_prototype_taxons- spree_reimbursement_credits- spree_role_users- spree_roles- spree_shipping_method_zones- ].each do |table|- add_column table, :updated_at, :datetime unless column_exists?(table, :updated_at)- end- end-enddiff --git a/core/db/migrate/20210713131614_add_unique_index_on_property_id_and_product_id_to_product_properties.rb b/core/db/migrate/20210713131614_add_unique_index_on_property_id_and_product_id_to_product_properties.rbdeleted file mode 100644index 8ba49dc52f..0000000000--- a/core/db/migrate/20210713131614_add_unique_index_on_property_id_and_product_id_to_product_properties.rb+++ /dev/null@@ -1,29 +0,0 @@-class AddUniqueIndexOnPropertyIdAndProductIdToProductProperties < ActiveRecord::Migration[5.2]- def up- klass = Spree::ProductProperty- columns = %w[property_id product_id]-- unless index_exists?(klass.table_name, columns)- scope = klass.unscoped-- say "Find duplicate #{klass} records"- duplicates = scope.- select((columns + %w[COUNT(*)]).join(',')).- group("#{columns.join(',')}").- having('COUNT(*) > 1').- map { |row| row.attributes.slice(*columns) }-- say "Delete all but the oldest duplicate #{klass} record"- duplicates.each do |conditions|- scope.where(conditions).order(:created_at).drop(1).each(&:destroy)- end-- say "Add unique index to #{klass.table_name} for #{columns.inspect}"- add_index klass.table_name, columns, unique: true- end- end-- def down- remove_index :spree_product_properties, [:property_id, :product_id]- end-enddiff --git a/core/db/migrate/20210715091956_add_store_id_to_spree_store_credits.rb b/core/db/migrate/20210715091956_add_store_id_to_spree_store_credits.rbdeleted file mode 100644index 021f37cdc5..0000000000--- a/core/db/migrate/20210715091956_add_store_id_to_spree_store_credits.rb+++ /dev/null@@ -1,10 +0,0 @@-class AddStoreIdToSpreeStoreCredits < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_store_credits, :store_id)- add_column :spree_store_credits, :store_id, :bigint- add_index :spree_store_credits, :store_id- Spree::StoreCredit.reset_column_information- Spree::StoreCredit.update_all(store_id: Spree::Store.default.id)- end- end-enddiff --git a/core/db/migrate/20210716093151_add_store_id_to_spree_taxonomies.rb b/core/db/migrate/20210716093151_add_store_id_to_spree_taxonomies.rbdeleted file mode 100644index 7726e8d634..0000000000--- a/core/db/migrate/20210716093151_add_store_id_to_spree_taxonomies.rb+++ /dev/null@@ -1,11 +0,0 @@-class AddStoreIdToSpreeTaxonomies < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_taxonomies, :store_id)- add_column :spree_taxonomies, :store_id, :bigint- add_index :spree_taxonomies, :store_id- add_index :spree_taxonomies, [:name, :store_id], unique: true- Spree::Taxonomy.reset_column_information- Spree::Taxonomy.update_all(store_id: Spree::Store.default.id)- end- end-enddiff --git a/core/db/migrate/20210716104141_add_index_on_name_parent_id_and_taxonomy_id_on_spree_taxons.rb b/core/db/migrate/20210716104141_add_index_on_name_parent_id_and_taxonomy_id_on_spree_taxons.rbdeleted file mode 100644index 6e1b46399f..0000000000--- a/core/db/migrate/20210716104141_add_index_on_name_parent_id_and_taxonomy_id_on_spree_taxons.rb+++ /dev/null@@ -1,31 +0,0 @@-class AddIndexOnNameParentIdAndTaxonomyIdOnSpreeTaxons < ActiveRecord::Migration[5.2]- def up- klass = Spree::Taxon- columns = %w[name parent_id taxonomy_id]-- unless index_exists?(klass.table_name, columns)- remove_index klass.table_name, columns if index_exists?(klass.table_name, columns)-- say "Find duplicate #{klass} records"- duplicates = klass.- select((columns + %w[COUNT(*)]).join(',')).- group("#{columns.join(',')}").- having('COUNT(*) > 1').- map { |row| row.attributes.slice(*columns) }-- say "Delete all but the oldest duplicate #{klass} record"- duplicates.each do |conditions|- klass.where(conditions).order(:created_at).drop(1).each(&:destroy)- end-- duplicates.each do |conditions| puts klass.where(conditions).order(:created_at).drop(1) end-- say "Add unique index to #{klass.table_name} for #{columns.inspect}"- add_index klass.table_name, columns, unique: true- end- end-- def down- remove_index :spree_taxons, [:name, :parent_id, :taxonomy_id]- end-enddiff --git a/core/db/migrate/20210721120857_add_index_on_permalink_parent_id_and_taxonomy_id_on_spree_taxons.rb b/core/db/migrate/20210721120857_add_index_on_permalink_parent_id_and_taxonomy_id_on_spree_taxons.rbdeleted file mode 100644index 0ba0efc0bf..0000000000--- a/core/db/migrate/20210721120857_add_index_on_permalink_parent_id_and_taxonomy_id_on_spree_taxons.rb+++ /dev/null@@ -1,31 +0,0 @@-class AddIndexOnPermalinkParentIdAndTaxonomyIdOnSpreeTaxons < ActiveRecord::Migration[5.2]- def up- klass = Spree::Taxon- columns = %w[permalink parent_id taxonomy_id]-- unless index_exists?(klass.table_name, columns)- remove_index klass.table_name, columns if index_exists?(klass.table_name, columns)-- say "Find duplicate #{klass} records"- duplicates = klass.- select((columns + %w[COUNT(*)]).join(',')).- group("#{columns.join(',')}").- having('COUNT(*) > 1').- map { |row| row.attributes.slice(*columns) }-- say "Delete all but the oldest duplicate #{klass} record"- duplicates.each do |conditions|- klass.where(conditions).order(:created_at).drop(1).each(&:destroy)- end-- duplicates.each do |conditions| puts klass.where(conditions).order(:created_at).drop(1) end-- say "Add unique index to #{klass.table_name} for #{columns.inspect}"- add_index klass.table_name, columns, unique: true- end- end-- def down- remove_index :spree_taxons, [:permalink, :parent_id, :taxonomy_id]- end-enddiff --git a/core/db/migrate/20210721125657_create_spree_promotions_stores.rb b/core/db/migrate/20210721125657_create_spree_promotions_stores.rbdeleted file mode 100644index df5a0a0b97..0000000000--- a/core/db/migrate/20210721125657_create_spree_promotions_stores.rb+++ /dev/null@@ -1,29 +0,0 @@-class CreateSpreePromotionsStores < ActiveRecord::Migration[5.2]- def up- unless table_exists?(:spree_promotions_stores)- create_table :spree_promotions_stores do |t|- t.references :promotion, index: true- t.references :store, index: true- t.timestamps-- t.index [:promotion_id, :store_id], unique: true- end-- stores = Spree::Store.all- promotion_ids = Spree::Promotion.order(:id).ids-- stores.find_each do |store|- prepared_values = promotion_ids.map { |id| "(#{id}, #{store.id}, '#{Time.current.to_s(:db)}', '#{Time.current.to_s(:db)}')" }.join(', ')- next if prepared_values.empty?-- begin- execute "INSERT INTO spree_promotions_stores (promotion_id, store_id, created_at, updated_at) VALUES #{prepared_values};"- rescue ActiveRecord::RecordNotUnique; end- end- end- end-- def down- drop_table :spree_promotions_stores- end-enddiff --git a/core/db/migrate/20210722090705_add_store_id_to_spree_customer_returns.rb b/core/db/migrate/20210722090705_add_store_id_to_spree_customer_returns.rbdeleted file mode 100644index b5a9963a75..0000000000--- a/core/db/migrate/20210722090705_add_store_id_to_spree_customer_returns.rb+++ /dev/null@@ -1,11 +0,0 @@-class AddStoreIdToSpreeCustomerReturns < ActiveRecord::Migration[5.2]- def change- unless column_exists?(:spree_customer_returns, :store_id)- add_column :spree_customer_returns, :store_id, :bigint- add_index :spree_customer_returns, :store_id- Spree::CustomerReturn.reset_column_information- default_store_id = Spree::Store.default.id- Spree::CustomerReturn.find_each { |cr| cr.update_column(:store_id, cr.order&.store_id || default_store_id) }- end- end-enddiff --git a/core/db/migrate/20210726065456_change_integer_id_columns_into_bigint.rb b/core/db/migrate/20210726065456_change_integer_id_columns_into_bigint.rbdeleted file mode 100644index ac25566de6..0000000000--- a/core/db/migrate/20210726065456_change_integer_id_columns_into_bigint.rb+++ /dev/null@@ -1,305 +0,0 @@-class ChangeIntegerIdColumnsIntoBigint < ActiveRecord::Migration[5.2]- def change- change_table(:active_storage_attachments) do |t|- t.change :record_id, :bigint- t.change :blob_id, :bigint- end-- change_column :friendly_id_slugs, :sluggable_id, :bigint-- change_table(:spree_addresses) do |t|- t.change :state_id, :bigint- t.change :country_id, :bigint- t.change :user_id, :bigint- end-- change_table(:spree_adjustments) do |t|- t.change :source_id, :bigint- t.change :adjustable_id, :bigint- t.change :order_id, :bigint- end-- change_column :spree_assets, :viewable_id, :bigint-- change_column :spree_calculators, :calculable_id, :bigint-- change_table(:spree_credit_cards) do |t|- t.change :address_id, :bigint- t.change :user_id, :bigint- t.change :payment_method_id, :bigint- end-- change_column :spree_customer_returns, :stock_location_id, :bigint-- change_table(:spree_inventory_units) do |t|- t.change :variant_id, :bigint- t.change :order_id, :bigint- t.change :shipment_id, :bigint- t.change :line_item_id, :bigint- t.change :original_return_item_id, :bigint- end-- change_table(:spree_line_items) do |t|- t.change :variant_id, :bigint- t.change :order_id, :bigint- t.change :tax_category_id, :bigint- end-- change_column :spree_log_entries, :source_id, :bigint-- change_table(:spree_menu_items) do |t|- t.change :linked_resource_id, :bigint- t.change :parent_id, :bigint- t.change :lft, :bigint- t.change :rgt, :bigint- t.change :menu_id, :bigint- end-- change_column :spree_menus, :store_id, :bigint-- change_table(:spree_option_type_prototypes) do |t|- t.change :prototype_id, :bigint- t.change :option_type_id, :bigint- end-- change_table(:spree_option_value_variants) do |t|- t.change :variant_id, :bigint- t.change :option_value_id, :bigint- end-- change_column :spree_option_values, :option_type_id, :bigint-- change_table(:spree_order_promotions) do |t|- t.change :order_id, :bigint- t.change :promotion_id, :bigint- end-- change_table(:spree_orders) do |t|- t.change :user_id, :bigint- t.change :bill_address_id, :bigint- t.change :ship_address_id, :bigint- t.change :created_by_id, :bigint- t.change :approver_id, :bigint- t.change :canceler_id, :bigint- t.change :store_id, :bigint- end-- change_column :spree_payment_capture_events, :payment_id, :bigint-- change_table(:spree_payment_methods_stores) do |t|- t.change :payment_method_id, :bigint- t.change :store_id, :bigint- end-- change_table(:spree_payments) do |t|- t.change :order_id, :bigint- t.change :source_id, :bigint- t.change :payment_method_id, :bigint- end-- change_column :spree_prices, :variant_id, :bigint-- change_table(:spree_product_option_types) do |t|- t.change :product_id, :bigint- t.change :option_type_id, :bigint- end-- change_table(:spree_product_promotion_rules) do |t|- t.change :product_id, :bigint- t.change :promotion_rule_id, :bigint- end-- change_table(:spree_product_properties) do |t|- t.change :product_id, :bigint- t.change :property_id, :bigint- end-- change_table(:spree_products) do |t|- t.change :tax_category_id, :bigint- t.change :shipping_category_id, :bigint- end-- change_table(:spree_products_stores) do |t|- t.change :product_id, :bigint- t.change :store_id, :bigint- end-- change_table(:spree_products_taxons) do |t|- t.change :product_id, :bigint- t.change :taxon_id, :bigint- end-- change_table(:spree_promotion_action_line_items) do |t|- t.change :promotion_action_id, :bigint- t.change :variant_id, :bigint- end-- change_column :spree_promotion_actions, :promotion_id, :bigint-- change_table(:spree_promotion_rule_taxons) do |t|- t.change :taxon_id, :bigint- t.change :promotion_rule_id, :bigint- end-- change_table(:spree_promotion_rule_users) do |t|- t.change :user_id, :bigint- t.change :promotion_rule_id, :bigint- end-- change_table(:spree_promotion_rules) do |t|- t.change :promotion_id, :bigint- t.change :user_id, :bigint- t.change :product_group_id, :bigint- end-- change_column :spree_promotions, :promotion_category_id, :bigint-- change_table(:spree_promotions_stores) do |t|- t.change :promotion_id, :bigint- t.change :store_id, :bigint- end-- change_table(:spree_property_prototypes) do |t|- t.change :prototype_id, :bigint- t.change :property_id, :bigint- end-- change_table(:spree_prototype_taxons) do |t|- t.change :taxon_id, :bigint- t.change :prototype_id, :bigint- end-- change_table(:spree_refunds) do |t|- t.change :payment_id, :bigint- t.change :refund_reason_id, :bigint- t.change :reimbursement_id, :bigint- end-- change_table(:spree_reimbursement_credits) do |t|- t.change :reimbursement_id, :bigint- t.change :creditable_id, :bigint- end-- change_table(:spree_reimbursements) do |t|- t.change :customer_return_id, :bigint- t.change :order_id, :bigint- end-- change_table(:spree_return_authorizations) do |t|- t.change :order_id, :bigint- t.change :stock_location_id, :bigint- t.change :return_authorization_reason_id, :bigint- end-- change_table(:spree_return_items) do |t|- t.change :return_authorization_id, :bigint- t.change :inventory_unit_id, :bigint- t.change :exchange_variant_id, :bigint- t.change :customer_return_id, :bigint- t.change :reimbursement_id, :bigint- t.change :preferred_reimbursement_type_id, :bigint- t.change :override_reimbursement_type_id, :bigint- end-- change_table(:spree_role_users) do |t|- t.change :role_id, :bigint- t.change :user_id, :bigint- end-- change_table(:spree_shipments) do |t|- t.change :order_id, :bigint- t.change :address_id, :bigint- t.change :stock_location_id, :bigint- end-- change_table(:spree_shipping_method_categories) do |t|- t.change :shipping_method_id, :bigint- t.change :shipping_category_id, :bigint- end-- change_table(:spree_shipping_method_zones) do |t|- t.change :shipping_method_id, :bigint- t.change :zone_id, :bigint- end-- change_column :spree_shipping_methods, :tax_category_id, :bigint-- change_table(:spree_shipping_rates) do |t|- t.change :shipment_id, :bigint- t.change :shipping_method_id, :bigint- t.change :tax_rate_id, :bigint- end-- change_table(:spree_state_changes) do |t|- t.change :stateful_id, :bigint- t.change :user_id, :bigint- end-- change_column :spree_states, :country_id, :bigint-- change_table(:spree_stock_items) do |t|- t.change :stock_location_id, :bigint- t.change :variant_id, :bigint- end-- change_table(:spree_stock_locations) do |t|- t.change :state_id, :bigint- t.change :country_id, :bigint- end-- change_table(:spree_stock_movements) do |t|- t.change :stock_item_id, :bigint- t.change :originator_id, :bigint- end-- change_table(:spree_stock_transfers) do |t|- t.change :source_location_id, :bigint- t.change :destination_location_id, :bigint- end-- change_table(:spree_store_credit_events) do |t|- t.change :store_credit_id, :bigint- t.change :originator_id, :bigint- end-- change_table(:spree_store_credits) do |t|- t.change :user_id, :bigint- t.change :category_id, :bigint- t.change :created_by_id, :bigint- t.change :originator_id, :bigint- t.change :type_id, :bigint- end-- change_table(:spree_stores) do |t|- t.change :default_country_id, :bigint- t.change :checkout_zone_id, :bigint- end-- change_table(:spree_tax_rates) do |t|- t.change :zone_id, :bigint- t.change :tax_category_id, :bigint- end-- change_table(:spree_taxons) do |t|- t.change :parent_id, :bigint- t.change :taxonomy_id, :bigint- t.change :lft, :bigint- t.change :rgt, :bigint- end-- change_table(:spree_users) do |t|- t.change :ship_address_id, :bigint- t.change :bill_address_id, :bigint- end-- change_table(:spree_variants) do |t|- t.change :product_id, :bigint- t.change :tax_category_id, :bigint- end-- change_table(:spree_zone_members) do |t|- t.change :zoneable_id, :bigint- t.change :zone_id, :bigint- end- end-enddiff --git a/core/db/migrate/20210730154425_fix_promotion_code_and_path_unique_indexes.rb b/core/db/migrate/20210730154425_fix_promotion_code_and_path_unique_indexes.rbdeleted file mode 100644index 835e31d01e..0000000000--- a/core/db/migrate/20210730154425_fix_promotion_code_and_path_unique_indexes.rb+++ /dev/null@@ -1,9 +0,0 @@-class FixPromotionCodeAndPathUniqueIndexes < ActiveRecord::Migration[5.2]- def change- # removing unique indexes- remove_index :spree_promotions, :code- # applying standard indexes- add_index :spree_promotions, :code- add_index :spree_promotions, :path unless index_exists?(:spree_promotions, :path)- end-enddiff --git a/core/db/migrate/20210914000000_spree_four_three.rb b/core/db/migrate/20210914000000_spree_four_three.rbnew file mode 100644index 0000000000..ef2c81d5dd--- /dev/null+++ b/core/db/migrate/20210914000000_spree_four_three.rb@@ -0,0 +1,1205 @@+class SpreeFourThree < ActiveRecord::Migration[5.2]+ def up+ # This migration is just a compressed version of all the previous+ # migrations for spree_core. Do not run it if one of the core tables+ # already exists. Assume the best.+ return if data_source_exists?(:spree_addresses)++ create_table "friendly_id_slugs", force: :cascade do |t|+ t.string "slug", null: false+ t.bigint "sluggable_id", null: false+ t.string "sluggable_type", limit: 50+ t.string "scope"+ t.datetime "created_at"+ t.datetime "deleted_at"+ t.index ["deleted_at"], name: "index_friendly_id_slugs_on_deleted_at"+ t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true+ t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"+ t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"+ t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"+ end++ create_table "spree_addresses", force: :cascade do |t|+ t.string "firstname"+ t.string "lastname"+ t.string "address1"+ t.string "address2"+ t.string "city"+ t.string "zipcode"+ t.string "phone"+ t.string "state_name"+ t.string "alternative_phone"+ t.string "company"+ t.bigint "state_id"+ t.bigint "country_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.bigint "user_id"+ t.datetime "deleted_at"+ t.string "label"+ t.index ["country_id"], name: "index_spree_addresses_on_country_id"+ t.index ["deleted_at"], name: "index_spree_addresses_on_deleted_at"+ t.index ["firstname"], name: "index_addresses_on_firstname"+ t.index ["lastname"], name: "index_addresses_on_lastname"+ t.index ["state_id"], name: "index_spree_addresses_on_state_id"+ t.index ["user_id"], name: "index_spree_addresses_on_user_id"+ end++ create_table "spree_adjustments", force: :cascade do |t|+ t.string "source_type"+ t.bigint "source_id"+ t.string "adjustable_type"+ t.bigint "adjustable_id"+ t.decimal "amount", precision: 10, scale: 2+ t.string "label"+ t.boolean "mandatory"+ t.boolean "eligible", default: true+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "state"+ t.bigint "order_id", null: false+ t.boolean "included", default: false+ t.index ["adjustable_id", "adjustable_type"], name: "index_spree_adjustments_on_adjustable_id_and_adjustable_type"+ t.index ["eligible"], name: "index_spree_adjustments_on_eligible"+ t.index ["order_id"], name: "index_spree_adjustments_on_order_id"+ t.index ["source_id", "source_type"], name: "index_spree_adjustments_on_source_id_and_source_type"+ end++ create_table "spree_assets", force: :cascade do |t|+ t.string "viewable_type"+ t.bigint "viewable_id"+ t.integer "attachment_width"+ t.integer "attachment_height"+ t.integer "attachment_file_size"+ t.integer "position"+ t.string "attachment_content_type"+ t.string "attachment_file_name"+ t.string "type", limit: 75+ t.datetime "attachment_updated_at"+ t.text "alt"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["position"], name: "index_spree_assets_on_position"+ t.index ["viewable_id"], name: "index_assets_on_viewable_id"+ t.index ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type"+ end++ create_table "spree_calculators", force: :cascade do |t|+ t.string "type"+ t.string "calculable_type"+ t.bigint "calculable_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.text "preferences"+ t.datetime "deleted_at"+ t.index ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type"+ t.index ["deleted_at"], name: "index_spree_calculators_on_deleted_at"+ t.index ["id", "type"], name: "index_spree_calculators_on_id_and_type"+ end++ create_table "spree_cms_pages", force: :cascade do |t|+ t.string "title", null: false+ t.string "meta_title"+ t.text "content"+ t.text "meta_description"+ t.boolean "visible", default: true+ t.string "slug"+ t.string "type"+ t.string "locale"+ t.datetime "deleted_at"+ t.bigint "store_id"+ t.datetime "created_at", null: false+ t.datetime "updated_at", null: false+ t.index ["deleted_at"], name: "index_spree_cms_pages_on_deleted_at"+ t.index ["slug", "store_id", "deleted_at"], name: "index_spree_cms_pages_on_slug_and_store_id_and_deleted_at"+ t.index ["slug", "store_id"], name: "index_spree_cms_pages_on_slug_and_store_id", unique: true+ t.index ["store_id", "locale", "type"], name: "index_spree_cms_pages_on_store_id_and_locale_and_type"+ t.index ["store_id"], name: "index_spree_cms_pages_on_store_id"+ t.index ["title", "type", "store_id"], name: "index_spree_cms_pages_on_title_and_type_and_store_id"+ t.index ["visible"], name: "index_spree_cms_pages_on_visible"+ end++ create_table "spree_cms_sections", force: :cascade do |t|+ t.string "name", null: false+ t.text "content"+ t.text "settings"+ t.string "fit"+ t.string "destination"+ t.string "type"+ t.integer "position"+ t.string "linked_resource_type"+ t.bigint "linked_resource_id"+ t.bigint "cms_page_id"+ t.datetime "created_at", null: false+ t.datetime "updated_at", null: false+ t.index ["cms_page_id"], name: "index_spree_cms_sections_on_cms_page_id"+ t.index ["linked_resource_type", "linked_resource_id"], name: "index_spree_cms_sections_on_linked_resource"+ t.index ["position"], name: "index_spree_cms_sections_on_position"+ t.index ["type"], name: "index_spree_cms_sections_on_type"+ end++ create_table "spree_countries", force: :cascade do |t|+ t.string "iso_name"+ t.string "iso", null: false+ t.string "iso3", null: false+ t.string "name"+ t.integer "numcode"+ t.boolean "states_required", default: false+ t.datetime "updated_at"+ t.boolean "zipcode_required", default: true+ t.datetime "created_at"+ t.index ["iso_name"], name: "index_spree_countries_on_iso_name", unique: true+ t.index ["name"], name: "index_spree_countries_on_name", unique: true+ t.index ["iso"], name: "index_spree_countries_on_iso", unique: true+ t.index ["iso3"], name: "index_spree_countries_on_iso3", unique: true+ end++ create_table "spree_credit_cards", force: :cascade do |t|+ t.string "month"+ t.string "year"+ t.string "cc_type"+ t.string "last_digits"+ t.bigint "address_id"+ t.string "gateway_customer_profile_id"+ t.string "gateway_payment_profile_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "name"+ t.bigint "user_id"+ t.bigint "payment_method_id"+ t.boolean "default", default: false, null: false+ t.datetime "deleted_at"+ t.index ["address_id"], name: "index_spree_credit_cards_on_address_id"+ t.index ["deleted_at"], name: "index_spree_credit_cards_on_deleted_at"+ t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id"+ t.index ["user_id"], name: "index_spree_credit_cards_on_user_id"+ end++ create_table "spree_customer_returns", force: :cascade do |t|+ t.string "number"+ t.bigint "stock_location_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.bigint "store_id"+ t.index ["number"], name: "index_spree_customer_returns_on_number", unique: true+ t.index ["stock_location_id"], name: "index_spree_customer_returns_on_stock_location_id"+ t.index ["store_id"], name: "index_spree_customer_returns_on_store_id"+ end++ create_table "spree_gateways", force: :cascade do |t|+ t.string "type"+ t.string "name"+ t.text "description"+ t.boolean "active", default: true+ t.string "environment", default: "development"+ t.string "server", default: "test"+ t.boolean "test_mode", default: true+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.text "preferences"+ t.index ["active"], name: "index_spree_gateways_on_active"+ t.index ["test_mode"], name: "index_spree_gateways_on_test_mode"+ end++ create_table "spree_inventory_units", force: :cascade do |t|+ t.string "state"+ t.bigint "variant_id"+ t.bigint "order_id"+ t.bigint "shipment_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.boolean "pending", default: true+ t.bigint "line_item_id"+ t.integer "quantity", default: 1+ t.bigint "original_return_item_id"+ t.index ["line_item_id"], name: "index_spree_inventory_units_on_line_item_id"+ t.index ["order_id"], name: "index_inventory_units_on_order_id"+ t.index ["original_return_item_id"], name: "index_spree_inventory_units_on_original_return_item_id"+ t.index ["shipment_id"], name: "index_inventory_units_on_shipment_id"+ t.index ["variant_id"], name: "index_inventory_units_on_variant_id"+ end++ create_table "spree_line_items", force: :cascade do |t|+ t.bigint "variant_id"+ t.bigint "order_id"+ t.integer "quantity", null: false+ t.decimal "price", precision: 10, scale: 2, null: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "currency"+ t.decimal "cost_price", precision: 10, scale: 2+ t.bigint "tax_category_id"+ t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0"+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"+ t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"+ t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false+ t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false+ t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.index ["order_id"], name: "index_spree_line_items_on_order_id"+ t.index ["tax_category_id"], name: "index_spree_line_items_on_tax_category_id"+ t.index ["variant_id"], name: "index_spree_line_items_on_variant_id"+ end++ create_table "spree_log_entries", force: :cascade do |t|+ t.string "source_type"+ t.bigint "source_id"+ t.text "details"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["source_id", "source_type"], name: "index_spree_log_entries_on_source_id_and_source_type"+ end++ create_table "spree_menu_items", force: :cascade do |t|+ t.string "name", null: false+ t.string "subtitle"+ t.string "destination"+ t.boolean "new_window", default: false+ t.string "item_type"+ t.string "linked_resource_type", default: "URL"+ t.bigint "linked_resource_id"+ t.string "code"+ t.bigint "parent_id"+ t.bigint "lft", null: false+ t.bigint "rgt", null: false+ t.integer "depth", default: 0, null: false+ t.bigint "menu_id"+ t.datetime "created_at", null: false+ t.datetime "updated_at", null: false+ t.index ["code"], name: "index_spree_menu_items_on_code"+ t.index ["depth"], name: "index_spree_menu_items_on_depth"+ t.index ["item_type"], name: "index_spree_menu_items_on_item_type"+ t.index ["lft"], name: "index_spree_menu_items_on_lft"+ t.index ["linked_resource_type", "linked_resource_id"], name: "index_spree_menu_items_on_linked_resource"+ t.index ["menu_id"], name: "index_spree_menu_items_on_menu_id"+ t.index ["parent_id"], name: "index_spree_menu_items_on_parent_id"+ t.index ["rgt"], name: "index_spree_menu_items_on_rgt"+ end++ create_table "spree_menus", force: :cascade do |t|+ t.string "name"+ t.string "location"+ t.string "locale"+ t.bigint "store_id"+ t.datetime "created_at", null: false+ t.datetime "updated_at", null: false+ t.index ["locale"], name: "index_spree_menus_on_locale"+ t.index ["store_id", "location", "locale"], name: "index_spree_menus_on_store_id_and_location_and_locale", unique: true+ t.index ["store_id"], name: "index_spree_menus_on_store_id"+ end++ create_table "spree_option_type_prototypes", force: :cascade do |t|+ t.bigint "prototype_id"+ t.bigint "option_type_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["option_type_id"], name: "index_spree_option_type_prototypes_on_option_type_id"+ t.index ["prototype_id", "option_type_id"], name: "spree_option_type_prototypes_prototype_id_option_type_id", unique: true+ t.index ["prototype_id"], name: "index_spree_option_type_prototypes_on_prototype_id"+ end++ create_table "spree_option_types", force: :cascade do |t|+ t.string "name", limit: 100+ t.string "presentation", limit: 100+ t.integer "position", default: 0, null: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.boolean "filterable", default: true, null: false+ t.index ["filterable"], name: "index_spree_option_types_on_filterable"+ t.index ["name"], name: "index_spree_option_types_on_name"+ t.index ["position"], name: "index_spree_option_types_on_position"+ end++ create_table "spree_option_value_variants", force: :cascade do |t|+ t.bigint "variant_id"+ t.bigint "option_value_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["option_value_id"], name: "index_spree_option_value_variants_on_option_value_id"+ t.index ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id", unique: true+ t.index ["variant_id"], name: "index_spree_option_value_variants_on_variant_id"+ end++ create_table "spree_option_values", force: :cascade do |t|+ t.integer "position"+ t.string "name"+ t.string "presentation"+ t.bigint "option_type_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["name"], name: "index_spree_option_values_on_name"+ t.index ["option_type_id"], name: "index_spree_option_values_on_option_type_id"+ t.index ["position"], name: "index_spree_option_values_on_position"+ end++ create_table "spree_order_promotions", force: :cascade do |t|+ t.bigint "order_id"+ t.bigint "promotion_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["order_id"], name: "index_spree_order_promotions_on_order_id"+ t.index ["promotion_id", "order_id"], name: "index_spree_order_promotions_on_promotion_id_and_order_id"+ t.index ["promotion_id"], name: "index_spree_order_promotions_on_promotion_id"+ end++ create_table "spree_orders", force: :cascade do |t|+ t.string "number", limit: 32+ t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false+ t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false+ t.string "state"+ t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.bigint "user_id"+ t.datetime "completed_at"+ t.bigint "bill_address_id"+ t.bigint "ship_address_id"+ t.decimal "payment_total", precision: 10, scale: 2, default: "0.0"+ t.string "shipment_state"+ t.string "payment_state"+ t.string "email"+ t.text "special_instructions"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "currency"+ t.string "last_ip_address"+ t.bigint "created_by_id"+ t.decimal "shipment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"+ t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"+ t.string "channel", default: "spree"+ t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false+ t.integer "item_count", default: 0+ t.bigint "approver_id"+ t.datetime "approved_at"+ t.boolean "confirmation_delivered", default: false+ t.boolean "considered_risky", default: false+ t.string "token"+ t.datetime "canceled_at"+ t.bigint "canceler_id"+ t.bigint "store_id"+ t.integer "state_lock_version", default: 0, null: false+ t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.boolean "store_owner_notification_delivered"+ t.index ["approver_id"], name: "index_spree_orders_on_approver_id"+ t.index ["bill_address_id"], name: "index_spree_orders_on_bill_address_id"+ t.index ["canceler_id"], name: "index_spree_orders_on_canceler_id"+ t.index ["completed_at"], name: "index_spree_orders_on_completed_at"+ t.index ["confirmation_delivered"], name: "index_spree_orders_on_confirmation_delivered"+ t.index ["considered_risky"], name: "index_spree_orders_on_considered_risky"+ t.index ["created_by_id"], name: "index_spree_orders_on_created_by_id"+ t.index ["number"], name: "index_spree_orders_on_number", unique: true+ t.index ["ship_address_id"], name: "index_spree_orders_on_ship_address_id"+ t.index ["store_id"], name: "index_spree_orders_on_store_id"+ t.index ["token"], name: "index_spree_orders_on_token"+ t.index ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id"+ end++ create_table "spree_payment_capture_events", force: :cascade do |t|+ t.decimal "amount", precision: 10, scale: 2, default: "0.0"+ t.bigint "payment_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["payment_id"], name: "index_spree_payment_capture_events_on_payment_id"+ end++ create_table "spree_payment_methods", force: :cascade do |t|+ t.string "type"+ t.string "name"+ t.text "description"+ t.boolean "active", default: true+ t.datetime "deleted_at"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "display_on", default: "both"+ t.boolean "auto_capture"+ t.text "preferences"+ t.integer "position", default: 0+ t.index ["id", "type"], name: "index_spree_payment_methods_on_id_and_type"+ end++ create_table "spree_payment_methods_stores", id: false, force: :cascade do |t|+ t.bigint "payment_method_id"+ t.bigint "store_id"+ t.index ["payment_method_id", "store_id"], name: "payment_mentod_id_store_id_unique_index", unique: true+ t.index ["payment_method_id"], name: "index_spree_payment_methods_stores_on_payment_method_id"+ t.index ["store_id"], name: "index_spree_payment_methods_stores_on_store_id"+ end++ create_table "spree_payments", force: :cascade do |t|+ t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false+ t.bigint "order_id"+ t.string "source_type"+ t.bigint "source_id"+ t.bigint "payment_method_id"+ t.string "state"+ t.string "response_code"+ t.string "avs_response"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "number"+ t.string "cvv_response_code"+ t.string "cvv_response_message"+ t.index ["number"], name: "index_spree_payments_on_number", unique: true+ t.index ["order_id"], name: "index_spree_payments_on_order_id"+ t.index ["payment_method_id"], name: "index_spree_payments_on_payment_method_id"+ t.index ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type"+ end++ create_table "spree_preferences", force: :cascade do |t|+ t.text "value"+ t.string "key"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["key"], name: "index_spree_preferences_on_key", unique: true+ end++ create_table "spree_prices", force: :cascade do |t|+ t.bigint "variant_id", null: false+ t.decimal "amount", precision: 10, scale: 2+ t.string "currency"+ t.datetime "deleted_at"+ t.datetime "created_at", null: false+ t.datetime "updated_at", null: false+ t.decimal "compare_at_amount", precision: 10, scale: 2+ t.index ["deleted_at"], name: "index_spree_prices_on_deleted_at"+ t.index ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency"+ t.index ["variant_id"], name: "index_spree_prices_on_variant_id"+ end++ create_table "spree_product_option_types", force: :cascade do |t|+ t.integer "position"+ t.bigint "product_id"+ t.bigint "option_type_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id"+ t.index ["position"], name: "index_spree_product_option_types_on_position"+ t.index ["product_id"], name: "index_spree_product_option_types_on_product_id"+ end++ create_table "spree_product_promotion_rules", force: :cascade do |t|+ t.bigint "product_id"+ t.bigint "promotion_rule_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["product_id"], name: "index_products_promotion_rules_on_product_id"+ t.index ["promotion_rule_id", "product_id"], name: "index_products_promotion_rules_on_promotion_rule_and_product"+ end++ create_table "spree_product_properties", force: :cascade do |t|+ t.string "value"+ t.bigint "product_id"+ t.bigint "property_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.integer "position", default: 0+ t.boolean "show_property", default: true+ t.string "filter_param"+ t.index ["filter_param"], name: "index_spree_product_properties_on_filter_param"+ t.index ["position"], name: "index_spree_product_properties_on_position"+ t.index ["product_id"], name: "index_product_properties_on_product_id"+ t.index ["property_id", "product_id"], name: "index_spree_product_properties_on_property_id_and_product_id", unique: true+ t.index ["property_id"], name: "index_spree_product_properties_on_property_id"+ end++ create_table "spree_products", force: :cascade do |t|+ t.string "name", default: "", null: false+ t.text "description"+ t.datetime "available_on"+ t.datetime "deleted_at"+ t.string "slug"+ t.text "meta_description"+ t.string "meta_keywords"+ t.bigint "tax_category_id"+ t.bigint "shipping_category_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.boolean "promotionable", default: true+ t.string "meta_title"+ t.datetime "discontinue_on"+ t.index ["available_on"], name: "index_spree_products_on_available_on"+ t.index ["deleted_at"], name: "index_spree_products_on_deleted_at"+ t.index ["discontinue_on"], name: "index_spree_products_on_discontinue_on"+ t.index ["name"], name: "index_spree_products_on_name"+ t.index ["shipping_category_id"], name: "index_spree_products_on_shipping_category_id"+ t.index ["slug"], name: "index_spree_products_on_slug", unique: true+ t.index ["tax_category_id"], name: "index_spree_products_on_tax_category_id"+ end++ create_table "spree_products_stores", force: :cascade do |t|+ t.bigint "product_id"+ t.bigint "store_id"+ t.datetime "created_at", null: false+ t.datetime "updated_at", null: false+ t.index ["product_id", "store_id"], name: "index_spree_products_stores_on_product_id_and_store_id", unique: true+ t.index ["product_id"], name: "index_spree_products_stores_on_product_id"+ t.index ["store_id"], name: "index_spree_products_stores_on_store_id"+ end++ create_table "spree_products_taxons", force: :cascade do |t|+ t.bigint "product_id"+ t.bigint "taxon_id"+ t.integer "position"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["position"], name: "index_spree_products_taxons_on_position"+ t.index ["product_id", "taxon_id"], name: "index_spree_products_taxons_on_product_id_and_taxon_id", unique: true+ t.index ["product_id"], name: "index_spree_products_taxons_on_product_id"+ t.index ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id"+ end++ create_table "spree_promotion_action_line_items", force: :cascade do |t|+ t.bigint "promotion_action_id"+ t.bigint "variant_id"+ t.integer "quantity", default: 1+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["promotion_action_id"], name: "index_spree_promotion_action_line_items_on_promotion_action_id"+ t.index ["variant_id"], name: "index_spree_promotion_action_line_items_on_variant_id"+ end++ create_table "spree_promotion_actions", force: :cascade do |t|+ t.bigint "promotion_id"+ t.integer "position"+ t.string "type"+ t.datetime "deleted_at"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at"+ t.index ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type"+ t.index ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id"+ end++ create_table "spree_promotion_categories", force: :cascade do |t|+ t.string "name"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "code"+ end++ create_table "spree_promotion_rule_taxons", force: :cascade do |t|+ t.bigint "taxon_id"+ t.bigint "promotion_rule_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["promotion_rule_id"], name: "index_spree_promotion_rule_taxons_on_promotion_rule_id"+ t.index ["taxon_id"], name: "index_spree_promotion_rule_taxons_on_taxon_id"+ end++ create_table "spree_promotion_rule_users", force: :cascade do |t|+ t.bigint "user_id"+ t.bigint "promotion_rule_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id"+ t.index ["user_id", "promotion_rule_id"], name: "index_promotion_rules_users_on_user_id_and_promotion_rule_id"+ end++ create_table "spree_promotion_rules", force: :cascade do |t|+ t.bigint "promotion_id"+ t.bigint "user_id"+ t.bigint "product_group_id"+ t.string "type"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "code"+ t.text "preferences"+ t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id"+ t.index ["promotion_id"], name: "index_spree_promotion_rules_on_promotion_id"+ t.index ["user_id"], name: "index_promotion_rules_on_user_id"+ end++ create_table "spree_promotions", force: :cascade do |t|+ t.string "description"+ t.datetime "expires_at"+ t.datetime "starts_at"+ t.string "name"+ t.string "type"+ t.integer "usage_limit"+ t.string "match_policy", default: "all"+ t.string "code"+ t.boolean "advertise", default: false+ t.string "path"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.bigint "promotion_category_id"+ t.index ["advertise"], name: "index_spree_promotions_on_advertise"+ t.index ["code"], name: "index_spree_promotions_on_code"+ t.index ["expires_at"], name: "index_spree_promotions_on_expires_at"+ t.index ["id", "type"], name: "index_spree_promotions_on_id_and_type"+ t.index ["path"], name: "index_spree_promotions_on_path"+ t.index ["promotion_category_id"], name: "index_spree_promotions_on_promotion_category_id"+ t.index ["starts_at"], name: "index_spree_promotions_on_starts_at"+ end++ create_table "spree_promotions_stores", force: :cascade do |t|+ t.bigint "promotion_id"+ t.bigint "store_id"+ t.datetime "created_at", null: false+ t.datetime "updated_at", null: false+ t.index ["promotion_id", "store_id"], name: "index_spree_promotions_stores_on_promotion_id_and_store_id", unique: true+ t.index ["promotion_id"], name: "index_spree_promotions_stores_on_promotion_id"+ t.index ["store_id"], name: "index_spree_promotions_stores_on_store_id"+ end++ create_table "spree_properties", force: :cascade do |t|+ t.string "name"+ t.string "presentation", null: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.boolean "filterable", default: false, null: false+ t.string "filter_param"+ t.index ["filter_param"], name: "index_spree_properties_on_filter_param"+ t.index ["filterable"], name: "index_spree_properties_on_filterable"+ t.index ["name"], name: "index_spree_properties_on_name"+ end++ create_table "spree_property_prototypes", force: :cascade do |t|+ t.bigint "prototype_id"+ t.bigint "property_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["property_id"], name: "index_spree_property_prototypes_on_property_id"+ t.index ["prototype_id", "property_id"], name: "index_property_prototypes_on_prototype_id_and_property_id", unique: true+ t.index ["prototype_id"], name: "index_spree_property_prototypes_on_prototype_id"+ end++ create_table "spree_prototype_taxons", force: :cascade do |t|+ t.bigint "taxon_id"+ t.bigint "prototype_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["prototype_id", "taxon_id"], name: "index_spree_prototype_taxons_on_prototype_id_and_taxon_id"+ t.index ["prototype_id"], name: "index_spree_prototype_taxons_on_prototype_id"+ t.index ["taxon_id"], name: "index_spree_prototype_taxons_on_taxon_id"+ end++ create_table "spree_prototypes", force: :cascade do |t|+ t.string "name"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ end++ create_table "spree_refund_reasons", force: :cascade do |t|+ t.string "name"+ t.boolean "active", default: true+ t.boolean "mutable", default: true+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["name"], name: "index_spree_refund_reasons_on_name", unique: true+ end++ create_table "spree_refunds", force: :cascade do |t|+ t.bigint "payment_id"+ t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false+ t.string "transaction_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.bigint "refund_reason_id"+ t.bigint "reimbursement_id"+ t.index ["payment_id"], name: "index_spree_refunds_on_payment_id"+ t.index ["refund_reason_id"], name: "index_refunds_on_refund_reason_id"+ t.index ["reimbursement_id"], name: "index_spree_refunds_on_reimbursement_id"+ end++ create_table "spree_reimbursement_credits", force: :cascade do |t|+ t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false+ t.bigint "reimbursement_id"+ t.bigint "creditable_id"+ t.string "creditable_type"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["creditable_id", "creditable_type"], name: "index_reimbursement_credits_on_creditable_id_and_type"+ t.index ["reimbursement_id"], name: "index_spree_reimbursement_credits_on_reimbursement_id"+ end++ create_table "spree_reimbursement_types", force: :cascade do |t|+ t.string "name"+ t.boolean "active", default: true+ t.boolean "mutable", default: true+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "type"+ t.index ["name"], name: "index_spree_reimbursement_types_on_name", unique: true+ t.index ["type"], name: "index_spree_reimbursement_types_on_type"+ end++ create_table "spree_reimbursements", force: :cascade do |t|+ t.string "number"+ t.string "reimbursement_status"+ t.bigint "customer_return_id"+ t.bigint "order_id"+ t.decimal "total", precision: 10, scale: 2+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["customer_return_id"], name: "index_spree_reimbursements_on_customer_return_id"+ t.index ["number"], name: "index_spree_reimbursements_on_number", unique: true+ t.index ["order_id"], name: "index_spree_reimbursements_on_order_id"+ end++ create_table "spree_return_authorization_reasons", force: :cascade do |t|+ t.string "name"+ t.boolean "active", default: true+ t.boolean "mutable", default: true+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["name"], name: "index_spree_return_authorization_reasons_on_name", unique: true+ end++ create_table "spree_return_authorizations", force: :cascade do |t|+ t.string "number"+ t.string "state"+ t.bigint "order_id"+ t.text "memo"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.bigint "stock_location_id"+ t.bigint "return_authorization_reason_id"+ t.index ["number"], name: "index_spree_return_authorizations_on_number", unique: true+ t.index ["order_id"], name: "index_spree_return_authorizations_on_order_id"+ t.index ["return_authorization_reason_id"], name: "index_return_authorizations_on_return_authorization_reason_id"+ t.index ["stock_location_id"], name: "index_spree_return_authorizations_on_stock_location_id"+ end++ create_table "spree_return_items", force: :cascade do |t|+ t.bigint "return_authorization_id"+ t.bigint "inventory_unit_id"+ t.bigint "exchange_variant_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false+ t.decimal "included_tax_total", precision: 12, scale: 4, default: "0.0", null: false+ t.decimal "additional_tax_total", precision: 12, scale: 4, default: "0.0", null: false+ t.string "reception_status"+ t.string "acceptance_status"+ t.bigint "customer_return_id"+ t.bigint "reimbursement_id"+ t.text "acceptance_status_errors"+ t.bigint "preferred_reimbursement_type_id"+ t.bigint "override_reimbursement_type_id"+ t.boolean "resellable", default: true, null: false+ t.index ["customer_return_id"], name: "index_return_items_on_customer_return_id"+ t.index ["exchange_variant_id"], name: "index_spree_return_items_on_exchange_variant_id"+ t.index ["inventory_unit_id"], name: "index_spree_return_items_on_inventory_unit_id"+ t.index ["override_reimbursement_type_id"], name: "index_spree_return_items_on_override_reimbursement_type_id"+ t.index ["preferred_reimbursement_type_id"], name: "index_spree_return_items_on_preferred_reimbursement_type_id"+ t.index ["reimbursement_id"], name: "index_spree_return_items_on_reimbursement_id"+ t.index ["return_authorization_id"], name: "index_spree_return_items_on_return_authorization_id"+ end++ create_table "spree_role_users", force: :cascade do |t|+ t.bigint "role_id"+ t.bigint "user_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["role_id"], name: "index_spree_role_users_on_role_id"+ t.index ["user_id"], name: "index_spree_role_users_on_user_id"+ end++ create_table "spree_roles", force: :cascade do |t|+ t.string "name"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["name"], name: "index_spree_roles_on_name", unique: true+ end++ create_table "spree_shipments", force: :cascade do |t|+ t.string "tracking"+ t.string "number"+ t.decimal "cost", precision: 10, scale: 2, default: "0.0"+ t.datetime "shipped_at"+ t.bigint "order_id"+ t.bigint "address_id"+ t.string "state"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.bigint "stock_location_id"+ t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0"+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"+ t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"+ t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false+ t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false+ t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false+ t.index ["address_id"], name: "index_spree_shipments_on_address_id"+ t.index ["number"], name: "index_spree_shipments_on_number", unique: true+ t.index ["order_id"], name: "index_spree_shipments_on_order_id"+ t.index ["stock_location_id"], name: "index_spree_shipments_on_stock_location_id"+ end++ create_table "spree_shipping_categories", force: :cascade do |t|+ t.string "name"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["name"], name: "index_spree_shipping_categories_on_name"+ end++ create_table "spree_shipping_method_categories", force: :cascade do |t|+ t.bigint "shipping_method_id", null: false+ t.bigint "shipping_category_id", null: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["shipping_category_id", "shipping_method_id"], name: "unique_spree_shipping_method_categories", unique: true+ t.index ["shipping_category_id"], name: "index_spree_shipping_method_categories_on_shipping_category_id"+ t.index ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id"+ end++ create_table "spree_shipping_method_zones", force: :cascade do |t|+ t.bigint "shipping_method_id"+ t.bigint "zone_id"+ t.datetime "created_at"+ t.datetime "updated_at"+ t.index ["shipping_method_id"], name: "index_spree_shipping_method_zones_on_shipping_method_id"+ t.index ["zone_id"], name: "index_spree_shipping_method_zones_on_zone_id"+ end++ create_table "spree_shipping_methods", force: :cascade do |t|+ t.string "name"+ t.string "display_on"+ t.datetime "deleted_at"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "tracking_url"+ t.string "admin_name"+ t.bigint "tax_category_id"+ t.string "code"+ t.index ["deleted_at"], name: "index_spree_shipping_methods_on_deleted_at"+ t.index ["tax_category_id"], name: "index_spree_shipping_methods_on_tax_category_id"+ end++ create_table "spree_shipping_rates", force: :cascade do |t|+ t.bigint "shipment_id"+ t.bigint "shipping_method_id"+ t.boolean "selected", default: false+ t.decimal "cost", precision: 8, scale: 2, default: "0.0"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.bigint "tax_rate_id"+ t.index ["selected"], name: "index_spree_shipping_rates_on_selected"+ t.index ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true+ t.index ["shipment_id"], name: "index_spree_shipping_rates_on_shipment_id"+ t.index ["shipping_method_id"], name: "index_spree_shipping_rates_on_shipping_method_id"+ t.index ["tax_rate_id"], name: "index_spree_shipping_rates_on_tax_rate_id"+ end++ create_table "spree_state_changes", force: :cascade do |t|+ t.string "name"+ t.string "previous_state"+ t.bigint "stateful_id"+ t.bigint "user_id"+ t.string "stateful_type"+ t.string "next_state"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["stateful_id", "stateful_type"], name: "index_spree_state_changes_on_stateful_id_and_stateful_type"+ end++ create_table "spree_states", force: :cascade do |t|+ t.string "name"+ t.string "abbr"+ t.bigint "country_id"+ t.datetime "updated_at"+ t.datetime "created_at"+ t.index ["country_id"], name: "index_spree_states_on_country_id"+ end++ create_table "spree_stock_items", force: :cascade do |t|+ t.bigint "stock_location_id"+ t.bigint "variant_id"+ t.integer "count_on_hand", default: 0, null: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.boolean "backorderable", default: false+ t.datetime "deleted_at"+ t.index ["backorderable"], name: "index_spree_stock_items_on_backorderable"+ t.index ["deleted_at"], name: "index_spree_stock_items_on_deleted_at"+ t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id"+ t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id"+ t.index ["variant_id"], name: "index_spree_stock_items_on_variant_id"+ end++ create_table "spree_stock_locations", force: :cascade do |t|+ t.string "name"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.boolean "default", default: false, null: false+ t.string "address1"+ t.string "address2"+ t.string "city"+ t.bigint "state_id"+ t.string "state_name"+ t.bigint "country_id"+ t.string "zipcode"+ t.string "phone"+ t.boolean "active", default: true+ t.boolean "backorderable_default", default: false+ t.boolean "propagate_all_variants", default: true+ t.string "admin_name"+ t.index ["active"], name: "index_spree_stock_locations_on_active"+ t.index ["backorderable_default"], name: "index_spree_stock_locations_on_backorderable_default"+ t.index ["country_id"], name: "index_spree_stock_locations_on_country_id"+ t.index ["propagate_all_variants"], name: "index_spree_stock_locations_on_propagate_all_variants"+ t.index ["state_id"], name: "index_spree_stock_locations_on_state_id"+ end++ create_table "spree_stock_movements", force: :cascade do |t|+ t.bigint "stock_item_id"+ t.integer "quantity", default: 0+ t.string "action"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "originator_type"+ t.bigint "originator_id"+ t.index ["originator_id", "originator_type"], name: "index_stock_movements_on_originator_id_and_originator_type"+ t.index ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id"+ end++ create_table "spree_stock_transfers", force: :cascade do |t|+ t.string "type"+ t.string "reference"+ t.bigint "source_location_id"+ t.bigint "destination_location_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "number"+ t.index ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id"+ t.index ["number"], name: "index_spree_stock_transfers_on_number", unique: true+ t.index ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id"+ end++ create_table "spree_store_credit_categories", force: :cascade do |t|+ t.string "name"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ end++ create_table "spree_store_credit_events", force: :cascade do |t|+ t.bigint "store_credit_id", null: false+ t.string "action", null: false+ t.decimal "amount", precision: 8, scale: 2+ t.string "authorization_code", null: false+ t.decimal "user_total_amount", precision: 8, scale: 2, default: "0.0", null: false+ t.bigint "originator_id"+ t.string "originator_type"+ t.datetime "deleted_at"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["originator_id", "originator_type"], name: "spree_store_credit_events_originator"+ t.index ["store_credit_id"], name: "index_spree_store_credit_events_on_store_credit_id"+ end++ create_table "spree_store_credit_types", force: :cascade do |t|+ t.string "name"+ t.integer "priority"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["priority"], name: "index_spree_store_credit_types_on_priority"+ end++ create_table "spree_store_credits", force: :cascade do |t|+ t.bigint "user_id"+ t.bigint "category_id"+ t.bigint "created_by_id"+ t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false+ t.decimal "amount_used", precision: 8, scale: 2, default: "0.0", null: false+ t.text "memo"+ t.datetime "deleted_at"+ t.string "currency"+ t.decimal "amount_authorized", precision: 8, scale: 2, default: "0.0", null: false+ t.bigint "originator_id"+ t.string "originator_type"+ t.bigint "type_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.bigint "store_id"+ t.index ["deleted_at"], name: "index_spree_store_credits_on_deleted_at"+ t.index ["originator_id", "originator_type"], name: "spree_store_credits_originator"+ t.index ["store_id"], name: "index_spree_store_credits_on_store_id"+ t.index ["type_id"], name: "index_spree_store_credits_on_type_id"+ t.index ["user_id"], name: "index_spree_store_credits_on_user_id"+ end++ create_table "spree_stores", force: :cascade do |t|+ t.string "name"+ t.string "url"+ t.text "meta_description"+ t.text "meta_keywords"+ t.string "seo_title"+ t.string "mail_from_address"+ t.string "default_currency"+ t.string "code"+ t.boolean "default", default: false, null: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "supported_currencies"+ t.string "facebook"+ t.string "twitter"+ t.string "instagram"+ t.string "default_locale"+ t.string "customer_support_email"+ t.bigint "default_country_id"+ t.text "description"+ t.text "address"+ t.string "contact_phone"+ t.string "new_order_notifications_email"+ t.bigint "checkout_zone_id"+ t.string "seo_robots"+ t.string "supported_locales"+ t.index ["code"], name: "index_spree_stores_on_code", unique: true+ t.index ["default"], name: "index_spree_stores_on_default"+ t.index ["url"], name: "index_spree_stores_on_url"+ end++ create_table "spree_tax_categories", force: :cascade do |t|+ t.string "name"+ t.string "description"+ t.boolean "is_default", default: false+ t.datetime "deleted_at"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "tax_code"+ t.index ["deleted_at"], name: "index_spree_tax_categories_on_deleted_at"+ t.index ["is_default"], name: "index_spree_tax_categories_on_is_default"+ end++ create_table "spree_tax_rates", force: :cascade do |t|+ t.decimal "amount", precision: 8, scale: 5+ t.bigint "zone_id"+ t.bigint "tax_category_id"+ t.boolean "included_in_price", default: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "name"+ t.boolean "show_rate_in_label", default: true+ t.datetime "deleted_at"+ t.index ["deleted_at"], name: "index_spree_tax_rates_on_deleted_at"+ t.index ["included_in_price"], name: "index_spree_tax_rates_on_included_in_price"+ t.index ["show_rate_in_label"], name: "index_spree_tax_rates_on_show_rate_in_label"+ t.index ["tax_category_id"], name: "index_spree_tax_rates_on_tax_category_id"+ t.index ["zone_id"], name: "index_spree_tax_rates_on_zone_id"+ end++ create_table "spree_taxonomies", force: :cascade do |t|+ t.string "name", null: false+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.integer "position", default: 0+ t.bigint "store_id"+ t.index ["name", "store_id"], name: "index_spree_taxonomies_on_name_and_store_id", unique: true+ t.index ["position"], name: "index_spree_taxonomies_on_position"+ t.index ["store_id"], name: "index_spree_taxonomies_on_store_id"+ end++ create_table "spree_taxons", force: :cascade do |t|+ t.bigint "parent_id"+ t.integer "position", default: 0+ t.string "name", null: false+ t.string "permalink"+ t.bigint "taxonomy_id"+ t.bigint "lft"+ t.bigint "rgt"+ t.text "description"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "meta_title"+ t.string "meta_description"+ t.string "meta_keywords"+ t.integer "depth"+ t.boolean "hide_from_nav", default: false+ t.index ["lft"], name: "index_spree_taxons_on_lft"+ t.index ["name", "parent_id", "taxonomy_id"], name: "index_spree_taxons_on_name_and_parent_id_and_taxonomy_id", unique: true+ t.index ["name"], name: "index_spree_taxons_on_name"+ t.index ["parent_id"], name: "index_taxons_on_parent_id"+ t.index ["permalink", "parent_id", "taxonomy_id"], name: "index_spree_taxons_on_permalink_and_parent_id_and_taxonomy_id", unique: true+ t.index ["permalink"], name: "index_taxons_on_permalink"+ t.index ["position"], name: "index_spree_taxons_on_position"+ t.index ["rgt"], name: "index_spree_taxons_on_rgt"+ t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id"+ end++ create_table "spree_trackers", force: :cascade do |t|+ t.string "analytics_id"+ t.boolean "active", default: true+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.integer "engine", default: 0, null: false+ t.index ["active"], name: "index_spree_trackers_on_active"+ end++ create_table "spree_users", force: :cascade do |t|+ t.string "encrypted_password", limit: 128+ t.string "password_salt", limit: 128+ t.string "email"+ t.string "remember_token"+ t.string "persistence_token"+ t.string "reset_password_token"+ t.string "perishable_token"+ t.integer "sign_in_count", default: 0, null: false+ t.integer "failed_attempts", default: 0, null: false+ t.datetime "last_request_at"+ t.datetime "current_sign_in_at"+ t.datetime "last_sign_in_at"+ t.string "current_sign_in_ip"+ t.string "last_sign_in_ip"+ t.string "login"+ t.bigint "ship_address_id"+ t.bigint "bill_address_id"+ t.string "authentication_token"+ t.string "unlock_token"+ t.datetime "locked_at"+ t.datetime "remember_created_at"+ t.datetime "reset_password_sent_at"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ end++ create_table "spree_variants", force: :cascade do |t|+ t.string "sku", default: "", null: false+ t.decimal "weight", precision: 8, scale: 2, default: "0.0"+ t.decimal "height", precision: 8, scale: 2+ t.decimal "width", precision: 8, scale: 2+ t.decimal "depth", precision: 8, scale: 2+ t.datetime "deleted_at"+ t.boolean "is_master", default: false+ t.bigint "product_id"+ t.decimal "cost_price", precision: 10, scale: 2+ t.integer "position"+ t.string "cost_currency"+ t.boolean "track_inventory", default: true+ t.bigint "tax_category_id"+ t.datetime "updated_at", null: false+ t.datetime "discontinue_on"+ t.datetime "created_at", null: false+ t.index ["deleted_at"], name: "index_spree_variants_on_deleted_at"+ t.index ["discontinue_on"], name: "index_spree_variants_on_discontinue_on"+ t.index ["is_master"], name: "index_spree_variants_on_is_master"+ t.index ["position"], name: "index_spree_variants_on_position"+ t.index ["product_id"], name: "index_spree_variants_on_product_id"+ t.index ["sku"], name: "index_spree_variants_on_sku"+ t.index ["tax_category_id"], name: "index_spree_variants_on_tax_category_id"+ t.index ["track_inventory"], name: "index_spree_variants_on_track_inventory"+ end++ create_table "spree_zone_members", force: :cascade do |t|+ t.string "zoneable_type"+ t.bigint "zoneable_id"+ t.bigint "zone_id"+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.index ["zone_id"], name: "index_spree_zone_members_on_zone_id"+ t.index ["zoneable_id", "zoneable_type"], name: "index_spree_zone_members_on_zoneable_id_and_zoneable_type"+ end++ create_table "spree_zones", force: :cascade do |t|+ t.string "name"+ t.string "description"+ t.boolean "default_tax", default: false+ t.integer "zone_members_count", default: 0+ t.datetime "created_at", precision: 6, null: false+ t.datetime "updated_at", precision: 6, null: false+ t.string "kind", default: "state"+ t.index ["default_tax"], name: "index_spree_zones_on_default_tax"+ t.index ["kind"], name: "index_spree_zones_on_kind"+ end+ end+enddiff --git a/core/db/migrate/20210831090344_add_deleted_at_to_spree_stores.rb b/core/db/migrate/20210920090344_add_deleted_at_to_spree_stores.rbsimilarity index 100%rename from core/db/migrate/20210831090344_add_deleted_at_to_spree_stores.rbrename to core/db/migrate/20210920090344_add_deleted_at_to_spree_stores.rbdiff --git a/sample/db/samples.rb b/sample/db/samples.rbindex 710c347efb..3a739393bf 100644--- a/sample/db/samples.rb+++ b/sample/db/samples.rb@@ -1,2 +1 @@Spree::Sample.load_sample('payment_methods')-Spree::Sample.load_sample('shipping_categories')diff --git a/sample/db/samples/orders.rb b/sample/db/samples/orders.rbindex 6dcc996a15..534e3738fd 100644--- a/sample/db/samples/orders.rb+++ b/sample/db/samples/orders.rb@@ -7,20 +7,22 @@ product_2 = Spree::Product.find_by!(name: 'Checked Shirt')orders = []orders << Spree::Order.where(number: 'R123456789',- email: '[email protected]'+ email: '[email protected]',+ currency: 'USD').first_or_create! do |order|- order.item_total = product_1.master.price- order.adjustment_total = product_1.master.price- order.total = product_1.master.price * 2+ order.item_total = product_1.master.amount_in(order.currency)+ order.adjustment_total = product_1.master.amount_in(order.currency)+ order.total = product_1.master.amount_in(order.currency) * 2endorders << Spree::Order.where(number: 'R987654321',- email: '[email protected]'+ email: '[email protected]',+ currency: 'USD').first_or_create! do |order|- order.item_total = product_2.master.price- order.adjustment_total = product_2.master.price- order.total = product_2.master.price * 2+ order.item_total = product_2.master.amount_in(order.currency)+ order.adjustment_total = product_2.master.amount_in(order.currency)+ order.total = product_2.master.amount_in(order.currency) * 2order.shipping_address = Spree::Address.firstorder.billing_address = Spree::Address.lastend@@ -29,7 +31,7 @@ unless orders[0].line_items.any?orders[0].line_items.new(variant: product_1.master,quantity: 1,- price: product_1.master.price+ price: product_1.master.amount_in(orders[0].currency)).save!end@@ -37,7 +39,7 @@ unless orders[1].line_items.any?orders[1].line_items.new(variant: product_2.master,quantity: 1,- price: product_1.master.price+ price: product_1.master.amount_in(orders[1].currency)).save!enddiff --git a/sample/db/samples/products.rb b/sample/db/samples/products.rbindex 3e58678070..608a47937b 100644--- a/sample/db/samples/products.rb+++ b/sample/db/samples/products.rb@@ -1,13 +1,12 @@require 'csv'Spree::Sample.load_sample('tax_categories')-Spree::Sample.load_sample('shipping_categories')Spree::Sample.load_sample('option_types')Spree::Sample.load_sample('taxons')Spree::Sample.load_sample('stores')-default_shipping_category = Spree::ShippingCategory.find_by!(name: 'Default')-clothing_tax_category = Spree::TaxCategory.find_by!(name: 'Clothing')+default_shipping_category = Spree::ShippingCategory.find_or_create_by!(name: 'Default')+clothing_tax_category = Spree::TaxCategory.find_or_create_by!(name: 'Clothing')Spree::Config[:currency] = 'USD'diff --git a/sample/db/samples/shipping_categories.rb b/sample/db/samples/shipping_categories.rbdeleted file mode 100644index 256ec8068b..0000000000--- a/sample/db/samples/shipping_categories.rb+++ /dev/null@@ -1 +0,0 @@-Spree::ShippingCategory.find_or_create_by!(name: 'Default')diff --git a/sample/lib/spree_sample.rb b/sample/lib/spree_sample.rbindex 5d579b38bd..4421947d90 100644--- a/sample/lib/spree_sample.rb+++ b/sample/lib/spree_sample.rb@@ -10,7 +10,6 @@ module SpreeSampleSpree::Sample.load_sample('addresses')Spree::Sample.load_sample('zones')Spree::Sample.load_sample('payment_methods')- Spree::Sample.load_sample('shipping_categories')Spree::Sample.load_sample('shipping_methods')Spree::Sample.load_sample('tax_categories')Spree::Sample.load_sample('tax_rates')