From a3f4f0dcf2a064d802b2a9cd0af7f08b2189a946 Mon Sep 17 00:00:00 2001 From: bouaik Date: Sat, 9 Nov 2024 14:33:58 +0100 Subject: [PATCH] fix incorrect rounding of final weight volume --- ...final_weight_volume_to_scale_3_in_spree_line_items.rb | 9 +++++++++ db/schema.rb | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20241101231144_change_final_weight_volume_to_scale_3_in_spree_line_items.rb diff --git a/db/migrate/20241101231144_change_final_weight_volume_to_scale_3_in_spree_line_items.rb b/db/migrate/20241101231144_change_final_weight_volume_to_scale_3_in_spree_line_items.rb new file mode 100644 index 00000000000..9f4eebd2083 --- /dev/null +++ b/db/migrate/20241101231144_change_final_weight_volume_to_scale_3_in_spree_line_items.rb @@ -0,0 +1,9 @@ +class ChangeFinalWeightVolumeToScale3InSpreeLineItems < ActiveRecord::Migration[7.0] + def up + change_column :spree_line_items, :final_weight_volume, :decimal, precision: 10, scale: 3 + end + + def down + change_column :spree_line_items, :final_weight_volume, :decimal, precision: 10, scale: 2 + end +end diff --git a/db/schema.rb b/db/schema.rb index 856aa02bbfb..ccd453137cc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_10_23_054951) do +ActiveRecord::Schema[7.0].define(version: 2024_11_01_231144) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "plpgsql" @@ -553,7 +553,7 @@ t.integer "max_quantity" t.string "currency", limit: 255 t.decimal "distribution_fee", precision: 10, scale: 2 - t.decimal "final_weight_volume", precision: 10, scale: 2 + t.decimal "final_weight_volume", precision: 10, scale: 3 t.integer "tax_category_id" t.decimal "weight", precision: 8, scale: 2 t.decimal "height", precision: 8, scale: 2