core/db/migrate/20240303174340_fix_spree_stock_item_unique_index.rb
Method change
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def change
remove_index :spree_stock_items, name: 'stock_item_by_loc_var_id_deleted_at' if index_exists?(:spree_stock_items, [:stock_location_id, :variant_id], name: 'stock_item_by_loc_var_id_deleted_at')
unless index_exists?(:spree_stock_items, ['variant_id', 'stock_location_id'], name: 'index_spree_stock_items_unique_without_deleted_at')
# MySQL doesn't support partial indexes