diff --git a/uc_product/uc_product.install b/uc_product/uc_product.install index a0216ad..9318d49 100644 --- a/uc_product/uc_product.install +++ b/uc_product/uc_product.install @@ -98,7 +98,7 @@ function uc_product_schema() { 'description' => 'Suggested retail price.', 'type' => 'numeric', 'precision' => 16, - 'scale' => 5, + 'scale' => 10, 'not null' => TRUE, 'default' => 0.0, ), @@ -106,7 +106,7 @@ function uc_product_schema() { 'description' => 'The amount the store pays to sell the product.', 'type' => 'numeric', 'precision' => 16, - 'scale' => 5, + 'scale' => 10, 'not null' => TRUE, 'default' => 0.0, ), @@ -114,7 +114,7 @@ function uc_product_schema() { 'description' => 'The amount the customer pays for the product.', 'type' => 'numeric', 'precision' => 16, - 'scale' => 5, + 'scale' => 10, 'not null' => TRUE, 'default' => 0.0, ), @@ -391,3 +391,16 @@ function uc_product_update_6009() { return $ret; } + +/** + * Change scale of decimal fields from 5 to 10. + */ +function uc_product_update_6010() { + $ret = array(); + + db_change_field($ret, 'uc_products', 'list_price', 'list_price', array('type' => 'numeric', 'precision' => 16, 'scale' => 10, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_products', 'cost', 'cost', array('type' => 'numeric', 'precision' => 16, 'scale' => 10, 'not null' => TRUE, 'default' => 0)); + db_change_field($ret, 'uc_products', 'sell_price', 'sell_price', array('type' => 'numeric', 'precision' => 16, 'scale' => 10, 'not null' => TRUE, 'default' => 0)); + + return $ret; +}