diff --git a/db/migrate/20181128054803_old_migrations_removed.rb b/db/migrate/20181128054803_old_migrations_removed.rb index 47d233f0aa..a8dc8b0454 100644 --- a/db/migrate/20181128054803_old_migrations_removed.rb +++ b/db/migrate/20181128054803_old_migrations_removed.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class OldMigrationsRemoved < ActiveRecord::Migration +class OldMigrationsRemoved < ActiveRecord::Migration[4.2] def up raise StandardError, <<-MESSAGE diff --git a/db/migrate/20190221131622_delete_account_invoices_preferences.rb b/db/migrate/20190221131622_delete_account_invoices_preferences.rb index e55a61f721..217078b52c 100644 --- a/db/migrate/20190221131622_delete_account_invoices_preferences.rb +++ b/db/migrate/20190221131622_delete_account_invoices_preferences.rb @@ -1,4 +1,4 @@ -class DeleteAccountInvoicesPreferences < ActiveRecord::Migration +class DeleteAccountInvoicesPreferences < ActiveRecord::Migration[4.2] def up Spree::Preference .where( key: ['spree/app_configuration/accounts_distributor_id', diff --git a/db/migrate/20190221131741_delete_account_invoices_adjustments.rb b/db/migrate/20190221131741_delete_account_invoices_adjustments.rb index 1f1af59594..dcd965cdae 100644 --- a/db/migrate/20190221131741_delete_account_invoices_adjustments.rb +++ b/db/migrate/20190221131741_delete_account_invoices_adjustments.rb @@ -1,4 +1,4 @@ -class DeleteAccountInvoicesAdjustments < ActiveRecord::Migration +class DeleteAccountInvoicesAdjustments < ActiveRecord::Migration[4.2] def up Spree::Adjustment .where(source_type: 'BillablePeriod') diff --git a/db/migrate/20190221214542_drop_enterprise_shop_trial_start_date.rb b/db/migrate/20190221214542_drop_enterprise_shop_trial_start_date.rb index 69dd360e2c..0c77f1a6db 100644 --- a/db/migrate/20190221214542_drop_enterprise_shop_trial_start_date.rb +++ b/db/migrate/20190221214542_drop_enterprise_shop_trial_start_date.rb @@ -1,4 +1,4 @@ -class DropEnterpriseShopTrialStartDate < ActiveRecord::Migration +class DropEnterpriseShopTrialStartDate < ActiveRecord::Migration[4.2] def up remove_column :enterprises, :shop_trial_start_date end diff --git a/db/migrate/20190303143409_drop_product_distributions.rb b/db/migrate/20190303143409_drop_product_distributions.rb index 73318a359d..9de25c9164 100644 --- a/db/migrate/20190303143409_drop_product_distributions.rb +++ b/db/migrate/20190303143409_drop_product_distributions.rb @@ -1,4 +1,4 @@ -class DropProductDistributions < ActiveRecord::Migration +class DropProductDistributions < ActiveRecord::Migration[4.2] def up drop_table :product_distributions end diff --git a/db/migrate/20190313142051_set_default_stock_location_on_shipments.rb b/db/migrate/20190313142051_set_default_stock_location_on_shipments.rb index 45add57fe3..66d5f6cbde 100644 --- a/db/migrate/20190313142051_set_default_stock_location_on_shipments.rb +++ b/db/migrate/20190313142051_set_default_stock_location_on_shipments.rb @@ -1,4 +1,4 @@ -class SetDefaultStockLocationOnShipments < ActiveRecord::Migration +class SetDefaultStockLocationOnShipments < ActiveRecord::Migration[4.2] def up if Spree::Shipment.where('stock_location_id IS NULL').count > 0 location = DefaultStockLocation.find_or_create diff --git a/db/migrate/20190313142540_add_shipping_category_to_shipping_methods_and_products.rb b/db/migrate/20190313142540_add_shipping_category_to_shipping_methods_and_products.rb index b51c9a67b0..f2e0eacf7b 100644 --- a/db/migrate/20190313142540_add_shipping_category_to_shipping_methods_and_products.rb +++ b/db/migrate/20190313142540_add_shipping_category_to_shipping_methods_and_products.rb @@ -1,4 +1,4 @@ -class AddShippingCategoryToShippingMethodsAndProducts < ActiveRecord::Migration +class AddShippingCategoryToShippingMethodsAndProducts < ActiveRecord::Migration[4.2] def up # This is different from the equivalent Spree migration # Here we are creating the default shipping category even if there are already shipping categories diff --git a/db/migrate/20190315224423_drop_account_invoices_and_billable_periods.rb b/db/migrate/20190315224423_drop_account_invoices_and_billable_periods.rb index 4aaa282221..a754dfc0e7 100644 --- a/db/migrate/20190315224423_drop_account_invoices_and_billable_periods.rb +++ b/db/migrate/20190315224423_drop_account_invoices_and_billable_periods.rb @@ -1,4 +1,4 @@ -class DropAccountInvoicesAndBillablePeriods < ActiveRecord::Migration +class DropAccountInvoicesAndBillablePeriods < ActiveRecord::Migration[4.2] def up drop_table :billable_periods drop_table :account_invoices diff --git a/db/migrate/20190320111312_delete_obsolete_pending_jobs.rb b/db/migrate/20190320111312_delete_obsolete_pending_jobs.rb index 043612971c..d753c9ba6b 100644 --- a/db/migrate/20190320111312_delete_obsolete_pending_jobs.rb +++ b/db/migrate/20190320111312_delete_obsolete_pending_jobs.rb @@ -1,4 +1,4 @@ -class DeleteObsoletePendingJobs < ActiveRecord::Migration +class DeleteObsoletePendingJobs < ActiveRecord::Migration[4.2] def up Delayed::Job.all.each do |job| job.delete if job.name == "FinalizeAccountInvoices" || diff --git a/db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb b/db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb index 3170545118..eade2ba9a6 100644 --- a/db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb +++ b/db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb @@ -1,4 +1,4 @@ -class AddDeletedAtToSpreeStockItems < ActiveRecord::Migration +class AddDeletedAtToSpreeStockItems < ActiveRecord::Migration[4.2] def up add_column :spree_stock_items, :deleted_at, :datetime end diff --git a/db/migrate/20190501143327_migrate_variants_on_demand_to_stock_items_backorderable.rb b/db/migrate/20190501143327_migrate_variants_on_demand_to_stock_items_backorderable.rb index 86d7a9d3ff..a507603120 100644 --- a/db/migrate/20190501143327_migrate_variants_on_demand_to_stock_items_backorderable.rb +++ b/db/migrate/20190501143327_migrate_variants_on_demand_to_stock_items_backorderable.rb @@ -1,4 +1,4 @@ -class MigrateVariantsOnDemandToStockItemsBackorderable < ActiveRecord::Migration +class MigrateVariantsOnDemandToStockItemsBackorderable < ActiveRecord::Migration[4.2] def up # We use SQL directly here to avoid going through VariantStock.on_demand and VariantStock.on_demand= sql = "update spree_stock_items set backorderable = (select on_demand from spree_variants where spree_variants.id = spree_stock_items.variant_id)" diff --git a/db/migrate/20190504151144_remove_field_name_from_exchange.rb b/db/migrate/20190504151144_remove_field_name_from_exchange.rb index 459c5f0444..5bd06e121e 100644 --- a/db/migrate/20190504151144_remove_field_name_from_exchange.rb +++ b/db/migrate/20190504151144_remove_field_name_from_exchange.rb @@ -1,4 +1,4 @@ -class RemoveFieldNameFromExchange < ActiveRecord::Migration +class RemoveFieldNameFromExchange < ActiveRecord::Migration[4.2] def up remove_column :exchanges, :payment_enterprise_id end diff --git a/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb b/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb index a95aae6eea..456f2b7fa4 100644 --- a/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb +++ b/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb @@ -1,4 +1,4 @@ -class UpdateStockLocationsBackorderableDefault < ActiveRecord::Migration +class UpdateStockLocationsBackorderableDefault < ActiveRecord::Migration[4.2] def change Spree::StockLocation.update_all(backorderable_default: false) end diff --git a/db/migrate/20190701002454_convert_string_fields_to_text.rb b/db/migrate/20190701002454_convert_string_fields_to_text.rb index 9d461c6070..b6c723747c 100644 --- a/db/migrate/20190701002454_convert_string_fields_to_text.rb +++ b/db/migrate/20190701002454_convert_string_fields_to_text.rb @@ -1,4 +1,4 @@ -class ConvertStringFieldsToText < ActiveRecord::Migration +class ConvertStringFieldsToText < ActiveRecord::Migration[4.2] def up change_column :enterprises, :description, :text change_column :enterprises, :pickup_times, :text diff --git a/db/migrate/20190830134723_add_deleted_at_to_spree_prices.rb b/db/migrate/20190830134723_add_deleted_at_to_spree_prices.rb index 949b7c11d9..c1159f8e5a 100644 --- a/db/migrate/20190830134723_add_deleted_at_to_spree_prices.rb +++ b/db/migrate/20190830134723_add_deleted_at_to_spree_prices.rb @@ -1,4 +1,4 @@ -class AddDeletedAtToSpreePrices < ActiveRecord::Migration +class AddDeletedAtToSpreePrices < ActiveRecord::Migration[4.2] def change add_column :spree_prices, :deleted_at, :datetime end diff --git a/db/migrate/20190906151259_reset_negative_stock_levels.rb b/db/migrate/20190906151259_reset_negative_stock_levels.rb index ec0be5a4be..0a060f9ebd 100644 --- a/db/migrate/20190906151259_reset_negative_stock_levels.rb +++ b/db/migrate/20190906151259_reset_negative_stock_levels.rb @@ -1,4 +1,4 @@ -class ResetNegativeStockLevels < ActiveRecord::Migration +class ResetNegativeStockLevels < ActiveRecord::Migration[4.2] def up # Reset stock to zero for all on_demand variants that have negative stock execute "UPDATE spree_stock_items SET count_on_hand = '0' WHERE count_on_hand < 0 AND backorderable IS TRUE" diff --git a/db/migrate/20190906165501_remove_broken_variants_from_carts.rb b/db/migrate/20190906165501_remove_broken_variants_from_carts.rb index 3e6cfaed10..1c1452b42d 100644 --- a/db/migrate/20190906165501_remove_broken_variants_from_carts.rb +++ b/db/migrate/20190906165501_remove_broken_variants_from_carts.rb @@ -1,4 +1,4 @@ -class RemoveBrokenVariantsFromCarts < ActiveRecord::Migration +class RemoveBrokenVariantsFromCarts < ActiveRecord::Migration[4.2] def up # Removes line_items from open carts where the variant has a hard-deleted price diff --git a/db/migrate/20190908183511_set_backordered_inventory_to_on_hand.rb b/db/migrate/20190908183511_set_backordered_inventory_to_on_hand.rb index c743a381ed..3295bb4da6 100644 --- a/db/migrate/20190908183511_set_backordered_inventory_to_on_hand.rb +++ b/db/migrate/20190908183511_set_backordered_inventory_to_on_hand.rb @@ -1,4 +1,4 @@ -class SetBackorderedInventoryToOnHand < ActiveRecord::Migration +class SetBackorderedInventoryToOnHand < ActiveRecord::Migration[4.2] def up execute("UPDATE spree_inventory_units SET state = 'on_hand' WHERE state = 'backordered'") end diff --git a/db/migrate/20190913023137_replace_hard_deleted_prices.rb b/db/migrate/20190913023137_replace_hard_deleted_prices.rb index 15b34c12a7..8f658f50c6 100644 --- a/db/migrate/20190913023137_replace_hard_deleted_prices.rb +++ b/db/migrate/20190913023137_replace_hard_deleted_prices.rb @@ -1,4 +1,4 @@ -class ReplaceHardDeletedPrices < ActiveRecord::Migration +class ReplaceHardDeletedPrices < ActiveRecord::Migration[4.2] def up ActiveRecord::Base.connection.execute( "INSERT into spree_prices (variant_id, amount, currency, deleted_at) diff --git a/db/migrate/20190916105416_add_long_compound_index_on_spree_orders.rb b/db/migrate/20190916105416_add_long_compound_index_on_spree_orders.rb index 5ff04483ec..2564a66488 100644 --- a/db/migrate/20190916105416_add_long_compound_index_on_spree_orders.rb +++ b/db/migrate/20190916105416_add_long_compound_index_on_spree_orders.rb @@ -1,4 +1,4 @@ -class AddLongCompoundIndexOnSpreeOrders < ActiveRecord::Migration +class AddLongCompoundIndexOnSpreeOrders < ActiveRecord::Migration[4.2] def change add_index( :spree_orders, diff --git a/db/migrate/20190916110029_drop_completed_at_index_on_spree_orders.rb b/db/migrate/20190916110029_drop_completed_at_index_on_spree_orders.rb index 47b5517295..2a65208ee3 100644 --- a/db/migrate/20190916110029_drop_completed_at_index_on_spree_orders.rb +++ b/db/migrate/20190916110029_drop_completed_at_index_on_spree_orders.rb @@ -1,4 +1,4 @@ -class DropCompletedAtIndexOnSpreeOrders < ActiveRecord::Migration +class DropCompletedAtIndexOnSpreeOrders < ActiveRecord::Migration[4.2] def change remove_index :spree_orders, :completed_at end diff --git a/db/migrate/20190918105234_remove_all_master_variants_from_exchanges.rb b/db/migrate/20190918105234_remove_all_master_variants_from_exchanges.rb index 1b6de20c30..c6ce2fbce7 100644 --- a/db/migrate/20190918105234_remove_all_master_variants_from_exchanges.rb +++ b/db/migrate/20190918105234_remove_all_master_variants_from_exchanges.rb @@ -1,4 +1,4 @@ -class RemoveAllMasterVariantsFromExchanges < ActiveRecord::Migration +class RemoveAllMasterVariantsFromExchanges < ActiveRecord::Migration[4.2] def up # 1. We add standard variants of the products of "lonely masters" into the Exchanges where the master variants are lonely match_master_variants diff --git a/db/migrate/20190922201034_drop_orders_shipping_method_id.rb b/db/migrate/20190922201034_drop_orders_shipping_method_id.rb index 4f35ec7e99..b5292837e0 100644 --- a/db/migrate/20190922201034_drop_orders_shipping_method_id.rb +++ b/db/migrate/20190922201034_drop_orders_shipping_method_id.rb @@ -1,4 +1,4 @@ -class DropOrdersShippingMethodId < ActiveRecord::Migration +class DropOrdersShippingMethodId < ActiveRecord::Migration[4.2] def up remove_column :spree_orders, :shipping_method_id end diff --git a/db/migrate/20191023105006_drop_prototypes_tables.rb b/db/migrate/20191023105006_drop_prototypes_tables.rb index 974cec87ea..be22c757b4 100644 --- a/db/migrate/20191023105006_drop_prototypes_tables.rb +++ b/db/migrate/20191023105006_drop_prototypes_tables.rb @@ -1,4 +1,4 @@ -class DropPrototypesTables < ActiveRecord::Migration +class DropPrototypesTables < ActiveRecord::Migration[4.2] def up drop_table :spree_option_types_prototypes drop_table :spree_properties_prototypes diff --git a/db/migrate/20191023172424_add_indexes_to_spree_orders.rb b/db/migrate/20191023172424_add_indexes_to_spree_orders.rb index d121049fb4..bf92cc844d 100644 --- a/db/migrate/20191023172424_add_indexes_to_spree_orders.rb +++ b/db/migrate/20191023172424_add_indexes_to_spree_orders.rb @@ -1,4 +1,4 @@ -class AddIndexesToSpreeOrders < ActiveRecord::Migration +class AddIndexesToSpreeOrders < ActiveRecord::Migration[4.2] def change add_index :spree_orders, :order_cycle_id add_index :spree_orders, :distributor_id diff --git a/db/migrate/20191202165700_add_custom_data_to_versions.rb b/db/migrate/20191202165700_add_custom_data_to_versions.rb index 45a10ed67e..ddc2c2f26a 100644 --- a/db/migrate/20191202165700_add_custom_data_to_versions.rb +++ b/db/migrate/20191202165700_add_custom_data_to_versions.rb @@ -1,4 +1,4 @@ -class AddCustomDataToVersions < ActiveRecord::Migration +class AddCustomDataToVersions < ActiveRecord::Migration[4.2] def change add_column :versions, :custom_data, :string end diff --git a/db/migrate/20200209163549_change_cvv_response_message_to_text_in_spree_payments.rb b/db/migrate/20200209163549_change_cvv_response_message_to_text_in_spree_payments.rb index 5e2e8d88ad..0e2fb44b72 100644 --- a/db/migrate/20200209163549_change_cvv_response_message_to_text_in_spree_payments.rb +++ b/db/migrate/20200209163549_change_cvv_response_message_to_text_in_spree_payments.rb @@ -1,4 +1,4 @@ -class ChangeCvvResponseMessageToTextInSpreePayments < ActiveRecord::Migration +class ChangeCvvResponseMessageToTextInSpreePayments < ActiveRecord::Migration[4.2] def up change_column :spree_payments, :cvv_response_message, :text end diff --git a/db/migrate/20200327105910_change_versions_custom_data_to_text.rb b/db/migrate/20200327105910_change_versions_custom_data_to_text.rb index 0a995a85f4..f5b43f9a81 100644 --- a/db/migrate/20200327105910_change_versions_custom_data_to_text.rb +++ b/db/migrate/20200327105910_change_versions_custom_data_to_text.rb @@ -1,4 +1,4 @@ -class ChangeVersionsCustomDataToText < ActiveRecord::Migration +class ChangeVersionsCustomDataToText < ActiveRecord::Migration[4.2] def up change_column :versions, :custom_data, :text end diff --git a/db/migrate/20200404080853_add_user_id_index_to_spree_orders.rb b/db/migrate/20200404080853_add_user_id_index_to_spree_orders.rb index cb8ef67b0e..46e760f04d 100644 --- a/db/migrate/20200404080853_add_user_id_index_to_spree_orders.rb +++ b/db/migrate/20200404080853_add_user_id_index_to_spree_orders.rb @@ -1,4 +1,4 @@ -class AddUserIdIndexToSpreeOrders < ActiveRecord::Migration +class AddUserIdIndexToSpreeOrders < ActiveRecord::Migration[4.2] def change add_index :spree_orders, :user_id end diff --git a/db/migrate/20200404081018_add_supplier_id_index_to_spree_products.rb b/db/migrate/20200404081018_add_supplier_id_index_to_spree_products.rb index eadc5a7c50..dd157c573d 100644 --- a/db/migrate/20200404081018_add_supplier_id_index_to_spree_products.rb +++ b/db/migrate/20200404081018_add_supplier_id_index_to_spree_products.rb @@ -1,4 +1,4 @@ -class AddSupplierIdIndexToSpreeProducts < ActiveRecord::Migration +class AddSupplierIdIndexToSpreeProducts < ActiveRecord::Migration[4.2] def change add_index :spree_products, :supplier_id end diff --git a/db/migrate/20200404083008_drop_trackers_table.rb b/db/migrate/20200404083008_drop_trackers_table.rb index 4dca8c7cfc..7f29258953 100644 --- a/db/migrate/20200404083008_drop_trackers_table.rb +++ b/db/migrate/20200404083008_drop_trackers_table.rb @@ -1,4 +1,4 @@ -class DropTrackersTable < ActiveRecord::Migration +class DropTrackersTable < ActiveRecord::Migration[4.2] def up drop_table :spree_trackers end diff --git a/db/migrate/20200404090436_remove_ga_cookies_preference.rb b/db/migrate/20200404090436_remove_ga_cookies_preference.rb index c509b11e5e..156d308dbe 100644 --- a/db/migrate/20200404090436_remove_ga_cookies_preference.rb +++ b/db/migrate/20200404090436_remove_ga_cookies_preference.rb @@ -1,4 +1,4 @@ -class RemoveGaCookiesPreference < ActiveRecord::Migration +class RemoveGaCookiesPreference < ActiveRecord::Migration[4.2] class Spree::Preference < ActiveRecord::Base; end def up diff --git a/db/migrate/20200406085833_increase_characters_of_locale_in_spree_users.rb b/db/migrate/20200406085833_increase_characters_of_locale_in_spree_users.rb index 5cac7dab5b..e1070cba7f 100644 --- a/db/migrate/20200406085833_increase_characters_of_locale_in_spree_users.rb +++ b/db/migrate/20200406085833_increase_characters_of_locale_in_spree_users.rb @@ -1,4 +1,4 @@ -class IncreaseCharactersOfLocaleInSpreeUsers < ActiveRecord::Migration +class IncreaseCharactersOfLocaleInSpreeUsers < ActiveRecord::Migration[4.2] def up change_column :spree_users, :locale, :string, limit: 6 end diff --git a/db/migrate/20200429122446_drop_mail_methods.rb b/db/migrate/20200429122446_drop_mail_methods.rb index 12dba55bbe..3efdabce91 100644 --- a/db/migrate/20200429122446_drop_mail_methods.rb +++ b/db/migrate/20200429122446_drop_mail_methods.rb @@ -1,4 +1,4 @@ -class DropMailMethods < ActiveRecord::Migration +class DropMailMethods < ActiveRecord::Migration[4.2] def up drop_table :spree_mail_methods diff --git a/db/migrate/20200430105459_add_timestamps_to_order_cycle_schedules.rb b/db/migrate/20200430105459_add_timestamps_to_order_cycle_schedules.rb index 5f57cd13a2..270977ad60 100644 --- a/db/migrate/20200430105459_add_timestamps_to_order_cycle_schedules.rb +++ b/db/migrate/20200430105459_add_timestamps_to_order_cycle_schedules.rb @@ -1,4 +1,4 @@ -class AddTimestampsToOrderCycleSchedules < ActiveRecord::Migration +class AddTimestampsToOrderCycleSchedules < ActiveRecord::Migration[4.2] def change change_table :order_cycle_schedules do |t| t.timestamps diff --git a/db/migrate/20200508101630_convert_frontend_shipping_method_to_both.rb b/db/migrate/20200508101630_convert_frontend_shipping_method_to_both.rb index 5e2418c3b8..c44dd18a1c 100644 --- a/db/migrate/20200508101630_convert_frontend_shipping_method_to_both.rb +++ b/db/migrate/20200508101630_convert_frontend_shipping_method_to_both.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class ConvertFrontendShippingMethodToBoth < ActiveRecord::Migration +class ConvertFrontendShippingMethodToBoth < ActiveRecord::Migration[4.2] def up # The display_on value front_end is not working # (it's not being used in the back office to ignore shipping methods marked as front_end) diff --git a/db/migrate/20200512070717_add_lock_version_to_stock_items.rb b/db/migrate/20200512070717_add_lock_version_to_stock_items.rb index 416a43f62e..24fc2eb9a9 100644 --- a/db/migrate/20200512070717_add_lock_version_to_stock_items.rb +++ b/db/migrate/20200512070717_add_lock_version_to_stock_items.rb @@ -1,4 +1,4 @@ -class AddLockVersionToStockItems < ActiveRecord::Migration +class AddLockVersionToStockItems < ActiveRecord::Migration[4.2] def change add_column :spree_stock_items, :lock_version, :integer, default: 0 end diff --git a/db/migrate/20200514174526_reset_negative_nonbackorderable_count_on_hand_in_stock_items.rb b/db/migrate/20200514174526_reset_negative_nonbackorderable_count_on_hand_in_stock_items.rb index c57730c99a..cc46f82d12 100644 --- a/db/migrate/20200514174526_reset_negative_nonbackorderable_count_on_hand_in_stock_items.rb +++ b/db/migrate/20200514174526_reset_negative_nonbackorderable_count_on_hand_in_stock_items.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class ResetNegativeNonbackorderableCountOnHandInStockItems < ActiveRecord::Migration +class ResetNegativeNonbackorderableCountOnHandInStockItems < ActiveRecord::Migration[4.2] module Spree class StockItem < ActiveRecord::Base self.table_name = "spree_stock_items" diff --git a/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb b/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb index b357242db2..8514b5e4ee 100644 --- a/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb +++ b/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class MoveAllCalculatorsOutsideTheSpreeNamespace < ActiveRecord::Migration +class MoveAllCalculatorsOutsideTheSpreeNamespace < ActiveRecord::Migration[4.2] def up convert_calculator("DefaultTax") convert_calculator("FlatPercentItemTotal") diff --git a/db/migrate/20200623140437_fix_preferences_keys.rb b/db/migrate/20200623140437_fix_preferences_keys.rb index 3f024ee278..08819689ff 100644 --- a/db/migrate/20200623140437_fix_preferences_keys.rb +++ b/db/migrate/20200623140437_fix_preferences_keys.rb @@ -1,4 +1,4 @@ -class FixPreferencesKeys < ActiveRecord::Migration +class FixPreferencesKeys < ActiveRecord::Migration[4.2] def up unmigrated_preferences = Spree::Preference.exists?(['key NOT LIKE ?', '/%']) return unless unmigrated_preferences diff --git a/db/migrate/20200624091611_make_timestamps_nullable.rb b/db/migrate/20200624091611_make_timestamps_nullable.rb index 32ea61ac43..545a84eb62 100644 --- a/db/migrate/20200624091611_make_timestamps_nullable.rb +++ b/db/migrate/20200624091611_make_timestamps_nullable.rb @@ -1,4 +1,4 @@ -class MakeTimestampsNullable < ActiveRecord::Migration +class MakeTimestampsNullable < ActiveRecord::Migration[4.2] def up change_column_null :customers, :created_at, true change_column_null :customers, :updated_at, true diff --git a/db/migrate/20200630070422_require_timestamps.rb b/db/migrate/20200630070422_require_timestamps.rb index 2075876bca..8d510288d3 100644 --- a/db/migrate/20200630070422_require_timestamps.rb +++ b/db/migrate/20200630070422_require_timestamps.rb @@ -1,4 +1,4 @@ -class RequireTimestamps < ActiveRecord::Migration +class RequireTimestamps < ActiveRecord::Migration[4.2] def up current_time = Time.zone.now diff --git a/db/migrate/20200702112157_add_stateful_id_index_to_state_changes.rb b/db/migrate/20200702112157_add_stateful_id_index_to_state_changes.rb index 8a52643cff..4cfff94491 100644 --- a/db/migrate/20200702112157_add_stateful_id_index_to_state_changes.rb +++ b/db/migrate/20200702112157_add_stateful_id_index_to_state_changes.rb @@ -1,4 +1,4 @@ -class AddStatefulIdIndexToStateChanges < ActiveRecord::Migration +class AddStatefulIdIndexToStateChanges < ActiveRecord::Migration[4.2] def change add_index :spree_state_changes, :stateful_id end diff --git a/db/migrate/20200721135726_move_calculators_preferences_outside_spree_namespace.rb b/db/migrate/20200721135726_move_calculators_preferences_outside_spree_namespace.rb index 2591550dd1..553288dfe8 100644 --- a/db/migrate/20200721135726_move_calculators_preferences_outside_spree_namespace.rb +++ b/db/migrate/20200721135726_move_calculators_preferences_outside_spree_namespace.rb @@ -1,6 +1,6 @@ # As we moved the calculators outside the Spree namespace in migration MoveAllCalculatorsOutsideTheSpreeNamespace # We need to move their preferences too (currency, value, etc), otherwise they are not used -class MoveCalculatorsPreferencesOutsideSpreeNamespace < ActiveRecord::Migration +class MoveCalculatorsPreferencesOutsideSpreeNamespace < ActiveRecord::Migration[4.2] def up replace_preferences_key("/spree/calculator", "/calculator") end diff --git a/db/migrate/20200817150002_add_terms_and_conditions_to_enterprises.rb b/db/migrate/20200817150002_add_terms_and_conditions_to_enterprises.rb index 57b646abd6..7f08cc2a53 100644 --- a/db/migrate/20200817150002_add_terms_and_conditions_to_enterprises.rb +++ b/db/migrate/20200817150002_add_terms_and_conditions_to_enterprises.rb @@ -1,4 +1,4 @@ -class AddTermsAndConditionsToEnterprises < ActiveRecord::Migration +class AddTermsAndConditionsToEnterprises < ActiveRecord::Migration[4.2] def change add_attachment :enterprises, :terms_and_conditions end diff --git a/db/migrate/20200907140555_add_customer_terms_and_conditions_accepted.rb b/db/migrate/20200907140555_add_customer_terms_and_conditions_accepted.rb index c48b1c19f2..95ed8158ba 100644 --- a/db/migrate/20200907140555_add_customer_terms_and_conditions_accepted.rb +++ b/db/migrate/20200907140555_add_customer_terms_and_conditions_accepted.rb @@ -1,4 +1,4 @@ -class AddCustomerTermsAndConditionsAccepted < ActiveRecord::Migration +class AddCustomerTermsAndConditionsAccepted < ActiveRecord::Migration[4.2] def change add_column :customers, :terms_and_conditions_accepted_at, :datetime end diff --git a/db/migrate/20200912190210_update_weight_calculators.rb b/db/migrate/20200912190210_update_weight_calculators.rb index 2a24138957..60adba69b1 100644 --- a/db/migrate/20200912190210_update_weight_calculators.rb +++ b/db/migrate/20200912190210_update_weight_calculators.rb @@ -1,4 +1,4 @@ -class UpdateWeightCalculators < ActiveRecord::Migration +class UpdateWeightCalculators < ActiveRecord::Migration[4.2] def change Spree::Calculator.connection.execute( "UPDATE spree_preferences SET key = replace( key, 'per_kg', 'per_unit') WHERE key ilike '/calculator/weight/per_kg/%'" diff --git a/db/migrate/20201113163155_repeat_move_all_calculators_outside_the_spree_namespace.rb b/db/migrate/20201113163155_repeat_move_all_calculators_outside_the_spree_namespace.rb index 60b127245f..47f4d76464 100644 --- a/db/migrate/20201113163155_repeat_move_all_calculators_outside_the_spree_namespace.rb +++ b/db/migrate/20201113163155_repeat_move_all_calculators_outside_the_spree_namespace.rb @@ -1,6 +1,6 @@ # For some unkonwn reason, after removing Spree as a dependency, some spree calculators appeared on live DBs # Here we repeat the migration -class RepeatMoveAllCalculatorsOutsideTheSpreeNamespace < ActiveRecord::Migration +class RepeatMoveAllCalculatorsOutsideTheSpreeNamespace < ActiveRecord::Migration[4.2] def up convert_calculator("DefaultTax") convert_calculator("FlatPercentItemTotal") diff --git a/db/migrate/20201113163227_repeat_move_calculators_preferences_outside_spree_namespace.rb b/db/migrate/20201113163227_repeat_move_calculators_preferences_outside_spree_namespace.rb index 24adad016b..84c52d26bf 100644 --- a/db/migrate/20201113163227_repeat_move_calculators_preferences_outside_spree_namespace.rb +++ b/db/migrate/20201113163227_repeat_move_calculators_preferences_outside_spree_namespace.rb @@ -1,6 +1,6 @@ # For some unkonwn reason, after removing Spree as a dependency, some spree calculators appeared on live DBs # Here we repeat the migration -class RepeatMoveCalculatorsPreferencesOutsideSpreeNamespace < ActiveRecord::Migration +class RepeatMoveCalculatorsPreferencesOutsideSpreeNamespace < ActiveRecord::Migration[4.2] def up replace_preferences_key("/spree/calculator", "/calculator") end diff --git a/db/migrate/20201219120055_add_order_to_adjustments.rb b/db/migrate/20201219120055_add_order_to_adjustments.rb index e0d6c32287..e1181c1eae 100644 --- a/db/migrate/20201219120055_add_order_to_adjustments.rb +++ b/db/migrate/20201219120055_add_order_to_adjustments.rb @@ -1,4 +1,4 @@ -class AddOrderToAdjustments < ActiveRecord::Migration +class AddOrderToAdjustments < ActiveRecord::Migration[4.2] class Spree::Adjustment < ActiveRecord::Base belongs_to :adjustable, polymorphic: true belongs_to :order, class_name: "Spree::Order" diff --git a/db/migrate/20201227122327_add_included_to_adjustments.rb b/db/migrate/20201227122327_add_included_to_adjustments.rb index 2ccbeab2a3..9fe8e838d4 100644 --- a/db/migrate/20201227122327_add_included_to_adjustments.rb +++ b/db/migrate/20201227122327_add_included_to_adjustments.rb @@ -1,4 +1,4 @@ -class AddIncludedToAdjustments < ActiveRecord::Migration +class AddIncludedToAdjustments < ActiveRecord::Migration[4.2] class Spree::TaxRate < ActiveRecord::Base; end class Spree::Adjustment < ActiveRecord::Base diff --git a/db/migrate/20210115143738_add_deleted_at_to_enterprise_fee.rb b/db/migrate/20210115143738_add_deleted_at_to_enterprise_fee.rb index f3afbf28d9..42fb42bb55 100644 --- a/db/migrate/20210115143738_add_deleted_at_to_enterprise_fee.rb +++ b/db/migrate/20210115143738_add_deleted_at_to_enterprise_fee.rb @@ -1,4 +1,4 @@ -class AddDeletedAtToEnterpriseFee < ActiveRecord::Migration +class AddDeletedAtToEnterpriseFee < ActiveRecord::Migration[4.2] def change add_column :enterprise_fees, :deleted_at, :datetime end diff --git a/db/migrate/20210123044336_add_tax_totals_to_order.rb b/db/migrate/20210123044336_add_tax_totals_to_order.rb index 64d99da532..b64836588a 100644 --- a/db/migrate/20210123044336_add_tax_totals_to_order.rb +++ b/db/migrate/20210123044336_add_tax_totals_to_order.rb @@ -1,4 +1,4 @@ -class AddTaxTotalsToOrder < ActiveRecord::Migration +class AddTaxTotalsToOrder < ActiveRecord::Migration[4.2] def up add_column :spree_orders, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 diff --git a/db/migrate/20210125123000_remove_enable_mail_delivery_preference.rb b/db/migrate/20210125123000_remove_enable_mail_delivery_preference.rb index a08642e931..7b9235b0ad 100644 --- a/db/migrate/20210125123000_remove_enable_mail_delivery_preference.rb +++ b/db/migrate/20210125123000_remove_enable_mail_delivery_preference.rb @@ -1,4 +1,4 @@ -class RemoveEnableMailDeliveryPreference < ActiveRecord::Migration +class RemoveEnableMailDeliveryPreference < ActiveRecord::Migration[4.2] def up Spree::Preference.delete_all("key ilike '%enable_mail_delivery%'") end diff --git a/db/migrate/20210125171611_populate_order_tax_totals.rb b/db/migrate/20210125171611_populate_order_tax_totals.rb index b466eca11c..47b206f622 100644 --- a/db/migrate/20210125171611_populate_order_tax_totals.rb +++ b/db/migrate/20210125171611_populate_order_tax_totals.rb @@ -1,4 +1,4 @@ -class PopulateOrderTaxTotals < ActiveRecord::Migration +class PopulateOrderTaxTotals < ActiveRecord::Migration[4.2] def up # Updates new order tax total fields (additional_tax_total and included_tax_total). # Sums the relevant values from associated adjustments and updates the two columns. diff --git a/db/migrate/20210127174120_add_cascading_deletes.rb b/db/migrate/20210127174120_add_cascading_deletes.rb index 3babe886b0..62692b7546 100644 --- a/db/migrate/20210127174120_add_cascading_deletes.rb +++ b/db/migrate/20210127174120_add_cascading_deletes.rb @@ -1,4 +1,4 @@ -class AddCascadingDeletes < ActiveRecord::Migration +class AddCascadingDeletes < ActiveRecord::Migration[4.2] def change # Updates foreign key definitions between orders, shipments, and inventory_units # to allow for cascading deletes at database level. If an order is intentionally diff --git a/db/migrate/20210130135946_increase_precion_on_currency_fields.rb b/db/migrate/20210130135946_increase_precion_on_currency_fields.rb index c2c43531fa..7738f88d60 100644 --- a/db/migrate/20210130135946_increase_precion_on_currency_fields.rb +++ b/db/migrate/20210130135946_increase_precion_on_currency_fields.rb @@ -1,4 +1,4 @@ -class IncreasePrecionOnCurrencyFields < ActiveRecord::Migration +class IncreasePrecionOnCurrencyFields < ActiveRecord::Migration[4.2] def up change_column :spree_line_items, :price, :decimal, precision: 10, scale: 2 change_column :spree_line_items, :cost_price, :decimal, precision: 10, scale: 2 diff --git a/db/migrate/20210203214304_rename_migs_payment_methods_to_check.rb b/db/migrate/20210203214304_rename_migs_payment_methods_to_check.rb index bec8eca69b..0db3dd58d3 100644 --- a/db/migrate/20210203214304_rename_migs_payment_methods_to_check.rb +++ b/db/migrate/20210203214304_rename_migs_payment_methods_to_check.rb @@ -1,4 +1,4 @@ -class RenameMigsPaymentMethodsToCheck < ActiveRecord::Migration +class RenameMigsPaymentMethodsToCheck < ActiveRecord::Migration[4.2] def change Spree::PaymentMethod .where(type: "Spree::Gateway::Migs") diff --git a/db/migrate/20210203215049_rename_pin_payment_methods_to_check.rb b/db/migrate/20210203215049_rename_pin_payment_methods_to_check.rb index bde3427d16..e4c78659a0 100644 --- a/db/migrate/20210203215049_rename_pin_payment_methods_to_check.rb +++ b/db/migrate/20210203215049_rename_pin_payment_methods_to_check.rb @@ -1,4 +1,4 @@ -class RenamePinPaymentMethodsToCheck < ActiveRecord::Migration +class RenamePinPaymentMethodsToCheck < ActiveRecord::Migration[4.2] def change Spree::PaymentMethod .where(type: "Spree::Gateway::Pin") diff --git a/db/migrate/20210207120753_add_tax_category_id_to_shipping_methods.rb b/db/migrate/20210207120753_add_tax_category_id_to_shipping_methods.rb index b330c066e8..cf2db90754 100644 --- a/db/migrate/20210207120753_add_tax_category_id_to_shipping_methods.rb +++ b/db/migrate/20210207120753_add_tax_category_id_to_shipping_methods.rb @@ -1,4 +1,4 @@ -class AddTaxCategoryIdToShippingMethods < ActiveRecord::Migration +class AddTaxCategoryIdToShippingMethods < ActiveRecord::Migration[4.2] def change add_column :spree_shipping_methods, :tax_category_id, :integer end diff --git a/db/migrate/20210207120825_set_default_shipment_cost.rb b/db/migrate/20210207120825_set_default_shipment_cost.rb index ce45e9d2e5..be71748cb1 100644 --- a/db/migrate/20210207120825_set_default_shipment_cost.rb +++ b/db/migrate/20210207120825_set_default_shipment_cost.rb @@ -1,4 +1,4 @@ -class SetDefaultShipmentCost < ActiveRecord::Migration +class SetDefaultShipmentCost < ActiveRecord::Migration[4.2] def up change_column_null :spree_shipments, :cost, false, 0.0 change_column_default :spree_shipments, :cost, 0.0 diff --git a/db/migrate/20210207131247_add_tax_totals_to_shipment.rb b/db/migrate/20210207131247_add_tax_totals_to_shipment.rb index 8627226fda..3e8a701159 100644 --- a/db/migrate/20210207131247_add_tax_totals_to_shipment.rb +++ b/db/migrate/20210207131247_add_tax_totals_to_shipment.rb @@ -1,4 +1,4 @@ -class AddTaxTotalsToShipment < ActiveRecord::Migration +class AddTaxTotalsToShipment < ActiveRecord::Migration[4.2] def up add_column :spree_shipments, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 diff --git a/db/migrate/20210207151520_add_adjustment_total_to_shipment.rb b/db/migrate/20210207151520_add_adjustment_total_to_shipment.rb index aeee8eac43..1c4139fbb2 100644 --- a/db/migrate/20210207151520_add_adjustment_total_to_shipment.rb +++ b/db/migrate/20210207151520_add_adjustment_total_to_shipment.rb @@ -1,4 +1,4 @@ -class AddAdjustmentTotalToShipment < ActiveRecord::Migration +class AddAdjustmentTotalToShipment < ActiveRecord::Migration[4.2] def up add_column :spree_shipments, :adjustment_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 diff --git a/db/migrate/20210211115125_migrate_shipment_fees_to_shipments.rb b/db/migrate/20210211115125_migrate_shipment_fees_to_shipments.rb index 46c4f9e55c..4172cd9d93 100644 --- a/db/migrate/20210211115125_migrate_shipment_fees_to_shipments.rb +++ b/db/migrate/20210211115125_migrate_shipment_fees_to_shipments.rb @@ -1,4 +1,4 @@ -class MigrateShipmentFeesToShipments < ActiveRecord::Migration +class MigrateShipmentFeesToShipments < ActiveRecord::Migration[4.2] class Spree::Adjustment < ActiveRecord::Base belongs_to :originator, polymorphic: true end diff --git a/db/migrate/20210216203057_remove_cost_price_from_variant_and_line_item.rb b/db/migrate/20210216203057_remove_cost_price_from_variant_and_line_item.rb index 5c9af2937c..444087ef7e 100644 --- a/db/migrate/20210216203057_remove_cost_price_from_variant_and_line_item.rb +++ b/db/migrate/20210216203057_remove_cost_price_from_variant_and_line_item.rb @@ -1,4 +1,4 @@ -class RemoveCostPriceFromVariantAndLineItem < ActiveRecord::Migration +class RemoveCostPriceFromVariantAndLineItem < ActiveRecord::Migration[4.2] def up remove_column :spree_variants, :cost_price remove_column :spree_line_items, :cost_price diff --git a/db/migrate/20210224190247_migrate_shipping_taxes.rb b/db/migrate/20210224190247_migrate_shipping_taxes.rb index cf536f9cf2..e1d6a34a92 100644 --- a/db/migrate/20210224190247_migrate_shipping_taxes.rb +++ b/db/migrate/20210224190247_migrate_shipping_taxes.rb @@ -1,4 +1,4 @@ -class MigrateShippingTaxes < ActiveRecord::Migration +class MigrateShippingTaxes < ActiveRecord::Migration[4.2] class Spree::Preference < ActiveRecord::Base; end class Spree::TaxCategory < ActiveRecord::Base has_many :tax_rates, class_name: "Spree::TaxRate", inverse_of: :tax_category diff --git a/db/migrate/20210227144926_migrate_payment_fees_to_payments.rb b/db/migrate/20210227144926_migrate_payment_fees_to_payments.rb index 5cd9c24ace..86b1a7857c 100644 --- a/db/migrate/20210227144926_migrate_payment_fees_to_payments.rb +++ b/db/migrate/20210227144926_migrate_payment_fees_to_payments.rb @@ -1,4 +1,4 @@ -class MigratePaymentFeesToPayments < ActiveRecord::Migration +class MigratePaymentFeesToPayments < ActiveRecord::Migration[4.2] class Spree::Adjustment < ActiveRecord::Base belongs_to :originator, polymorphic: true end diff --git a/db/migrate/20210228223114_migrate_line_item_fees.rb b/db/migrate/20210228223114_migrate_line_item_fees.rb index f923a7b7b5..f7e0a0bcf7 100644 --- a/db/migrate/20210228223114_migrate_line_item_fees.rb +++ b/db/migrate/20210228223114_migrate_line_item_fees.rb @@ -1,4 +1,4 @@ -class MigrateLineItemFees < ActiveRecord::Migration +class MigrateLineItemFees < ActiveRecord::Migration[4.2] class Spree::Adjustment < ActiveRecord::Base belongs_to :originator, polymorphic: true belongs_to :source, polymorphic: true