=== modified file 'payment/uc_google_checkout/uc_google_checkout.install' --- payment/uc_google_checkout/uc_google_checkout.install 2009-01-05 15:20:34 +0000 +++ payment/uc_google_checkout/uc_google_checkout.install 2009-09-22 18:05:29 +0000 @@ -81,8 +81,8 @@ ), 'gc_total' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -201,10 +201,15 @@ return array(); } -function uc_google_checkout_update_6002() { +// Removed obsolete update 6002. + +/** + * Change currency fields to numeric(16,5). + */ +function uc_google_checkout_update_6003() { $ret = array(); - db_change_field($ret, 'uc_gc_orders', 'gc_total', 'gc_total', array('type' => 'numeric', 'precision' => 15, 'scale' => 3, 'not null' => TRUE, 'default' => 0.0)); + db_change_field($ret, 'uc_gc_orders', 'gc_total', 'gc_total', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0.0)); return $ret; } === modified file 'payment/uc_payment/uc_payment.install' --- payment/uc_payment/uc_payment.install 2009-06-17 15:27:58 +0000 +++ payment/uc_payment/uc_payment.install 2009-09-22 18:04:36 +0000 @@ -30,8 +30,8 @@ ), 'amount' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), @@ -148,10 +148,15 @@ return $ret; } -function uc_payment_update_6001() { +// Removed obsolete update 6001. + +/** + * Change currency fields to numeric(16,5). + */ +function uc_payment_update_6002() { $ret = array(); - db_change_field($ret, 'uc_payment_receipts', 'amount', 'amount', array('type' => 'numeric', 'precision' => 15, 'scale' => 3, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_payment_receipts', 'amount', 'amount', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); return $ret; } === modified file 'shipping/uc_flatrate/uc_flatrate.install' --- shipping/uc_flatrate/uc_flatrate.install 2009-05-14 21:04:36 +0000 +++ shipping/uc_flatrate/uc_flatrate.install 2009-09-22 16:15:19 +0000 @@ -34,8 +34,8 @@ ), 'rate' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => FALSE, ), ), @@ -63,15 +63,15 @@ ), 'base_rate' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), 'product_rate' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -249,20 +249,17 @@ return $ret; } -function uc_flatrate_update_6001() { - $ret = array(); - - db_change_field($ret, 'uc_flatrate_products', 'rate', 'rate', array('type' => 'numeric', 'precision' => 10, 'scale' => 2, 'not null' => FALSE)); - - return $ret; -} - -function uc_flatrate_update_6002() { - $ret = array(); - - db_change_field($ret, 'uc_flatrate_products', 'rate', 'rate', array('type' => 'numeric', 'precision' => 15, 'scale' => 3, 'not null' => FALSE)); - db_change_field($ret, 'uc_flatrate_methods', 'base_rate', 'base_rate', array('type' => 'numeric', 'precision' => 15, 'scale' => 3, 'not null' => FALSE)); - db_change_field($ret, 'uc_flatrate_methods', 'product_rate', 'product_rate', array('type' => 'numeric', 'precision' => 15, 'scale' => 3, 'not null' => FALSE)); +// Removed obsolete updates 6001 and 6002. + +/** + * Change currency fields to numeric(16, 5). + */ +function uc_flatrate_update_6003() { + $ret = array(); + + db_change_field($ret, 'uc_flatrate_products', 'rate', 'rate', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => FALSE)); + db_change_field($ret, 'uc_flatrate_methods', 'base_rate', 'base_rate', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => FALSE)); + db_change_field($ret, 'uc_flatrate_methods', 'product_rate', 'product_rate', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => FALSE)); return $ret; } === modified file 'shipping/uc_quote/uc_quote.install' --- shipping/uc_quote/uc_quote.install 2009-05-14 21:04:36 +0000 +++ shipping/uc_quote/uc_quote.install 2009-09-22 18:06:14 +0000 @@ -130,8 +130,8 @@ ), 'rate' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), @@ -365,3 +365,14 @@ return $ret; } + +/** + * Change currency fields to numeric(16,5). + */ +function uc_quote_update_6004() { + $ret = array(); + + db_change_field($ret, 'uc_order_quotes', 'rate', 'rate', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + + return $ret; +} === modified file 'shipping/uc_shipping/uc_shipping.install' --- shipping/uc_shipping/uc_shipping.install 2009-05-14 21:04:36 +0000 +++ shipping/uc_shipping/uc_shipping.install 2009-09-22 18:03:21 +0000 @@ -179,8 +179,8 @@ ), 'cost' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -232,8 +232,8 @@ ), 'value' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => FALSE, 'default' => 0.0, ), @@ -389,3 +389,16 @@ return $ret; } + +/** + * Change currency fields to numeric(16,5). + */ +function uc_shipping_update_6005() { + $ret = array(); + + db_change_field($ret, 'uc_shipments', 'cost', 'cost', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_packages', 'value', 'value', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => FALSE)); + + return $ret; +} + === modified file 'shipping/uc_weightquote/uc_weightquote.install' --- shipping/uc_weightquote/uc_weightquote.install 2009-08-20 17:22:42 +0000 +++ shipping/uc_weightquote/uc_weightquote.install 2009-09-22 17:57:04 +0000 @@ -34,8 +34,8 @@ ), 'rate' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => FALSE, ), ), @@ -63,15 +63,15 @@ ), 'base_rate' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), 'product_rate' => array( 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -220,3 +220,13 @@ return $ret; } + +function uc_weightquote_update_6002() { + $ret = array(); + + db_change_field($ret, 'uc_weightquote_products', 'rate', 'rate', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => FALSE)); + db_change_field($ret, 'uc_weightquote_methods', 'base_rate', 'base_rate', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => FALSE)); + db_change_field($ret, 'uc_weightquote_methods', 'product_rate', 'product_rate', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => FALSE)); + + return $ret; +} === modified file 'uc_attribute/uc_attribute.install' --- uc_attribute/uc_attribute.install 2009-07-01 15:58:50 +0000 +++ uc_attribute/uc_attribute.install 2009-09-22 18:03:21 +0000 @@ -95,16 +95,16 @@ 'cost' => array( 'description' => t("The adjustment to a product's cost with the chosen option."), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), 'price' => array( 'description' => t("The adjustment to a product's price with the chosen option."), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), @@ -203,16 +203,16 @@ 'cost' => array( 'description' => t("The adjustment to a product's cost with the chosen option."), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), 'price' => array( 'description' => t("The adjustment to a product's price with the chosen option."), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), @@ -311,16 +311,16 @@ 'cost' => array( 'description' => t("The adjustment to a product's cost with the chosen option."), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), 'price' => array( 'description' => t("The adjustment to a product's price with the chosen option."), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0, ), @@ -703,3 +703,19 @@ return $ret; } + +/** + * Change currency fields to numeric(16,5). + */ +function uc_attribute_update_6005() { + $ret = array(); + + db_change_field($ret, 'uc_attribute_options', 'cost', 'cost', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_attribute_options', 'price', 'price', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_class_attribute_options', 'cost', 'cost', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_class_attribute_options', 'price', 'price', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_product_options', 'cost', 'cost', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_product_options', 'price', 'price', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + + return $ret; +} === modified file 'uc_order/uc_order.install' --- uc_order/uc_order.install 2009-09-16 18:28:32 +0000 +++ uc_order/uc_order.install 2009-09-22 18:00:09 +0000 @@ -38,8 +38,8 @@ 'order_total' => array( 'description' => t('The total amount to be paid for the order.'), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -366,8 +366,8 @@ 'amount' => array( 'description' => t("The amount of the line item in the store's currency."), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -485,16 +485,16 @@ 'cost' => array( 'description' => t('The cost to the store for the product.'), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), 'price' => array( 'description' => t('The price paid for the ordered product.'), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -1125,3 +1125,16 @@ return $save; } +/** + * Change currency fields to numeric(16,5). + */ +function uc_order_update_6014() { + $ret = array(); + + db_change_field($ret, 'uc_orders', 'order_total', 'order_total', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0.0)); + db_change_field($ret, 'uc_order_line_items', 'amount', 'amount', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0.0)); + db_change_field($ret, 'uc_order_products', 'cost', 'cost', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_order_products', 'price', 'price', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + + return $ret; +} === modified file 'uc_product/uc_product.install' --- uc_product/uc_product.install 2009-08-27 17:53:42 +0000 +++ uc_product/uc_product.install 2009-09-22 18:06:39 +0000 @@ -94,24 +94,24 @@ 'list_price' => array( 'description' => t('Suggested retail price.'), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), 'cost' => array( 'description' => t('The amount the store pays to sell the product.'), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), 'sell_price' => array( 'description' => t('The amount the customer pays for the product.'), 'type' => 'numeric', - 'precision' => 15, - 'scale' => 3, + 'precision' => 16, + 'scale' => 5, 'not null' => TRUE, 'default' => 0.0, ), @@ -619,3 +619,16 @@ return $ret; } + +/** + * Change currency fields to numeric(16,5). + */ +function uc_product_update_6009() { + $ret = array(); + + db_change_field($ret, 'uc_products', 'list_price', 'list_price', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_products', 'cost', 'cost', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_products', 'sell_price', 'sell_price', array('type' => 'numeric', 'precision' => 16, 'scale' => 5, 'not null' => TRUE, 'default' => 0)); + + return $ret; +}