From f5e61d50ee6647733b2866bc281b82e24c2efbb6 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Tue, 6 Oct 2020 11:48:01 +0100 Subject: [PATCH] change civicrm_price_set.min_amount to float --- CRM/Price/DAO/PriceSet.php | 12 ++++++++---- CRM/Upgrade/Incremental/sql/5.31.alpha1.mysql.tpl | 2 ++ xml/schema/Price/PriceSet.xml | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CRM/Price/DAO/PriceSet.php b/CRM/Price/DAO/PriceSet.php index 26fa138098..3c62426ff7 100644 --- a/CRM/Price/DAO/PriceSet.php +++ b/CRM/Price/DAO/PriceSet.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Price/PriceSet.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:c4db3cbda4900e01aeba098a4578b563) + * (GenCodeChecksum:98eebd80f22712ce0809cec244b6f92a) */ /** @@ -117,7 +117,7 @@ class CRM_Price_DAO_PriceSet extends CRM_Core_DAO { /** * Minimum Amount required for this set. * - * @var int + * @var float */ public $min_amount; @@ -382,11 +382,15 @@ class CRM_Price_DAO_PriceSet extends CRM_Core_DAO { ], 'min_amount' => [ 'name' => 'min_amount', - 'type' => CRM_Utils_Type::T_INT, + 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Minimum Amount'), 'description' => ts('Minimum Amount required for this set.'), + 'precision' => [ + 20, + 2, + ], 'where' => 'civicrm_price_set.min_amount', - 'default' => '0', + 'default' => '0.0', 'table_name' => 'civicrm_price_set', 'entity' => 'PriceSet', 'bao' => 'CRM_Price_BAO_PriceSet', diff --git a/CRM/Upgrade/Incremental/sql/5.31.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.31.alpha1.mysql.tpl index 3c5148fc51..68d45857c9 100644 --- a/CRM/Upgrade/Incremental/sql/5.31.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.31.alpha1.mysql.tpl @@ -41,3 +41,5 @@ INSERT IGNORE INTO civicrm_state_province (country_id, abbreviation, name) VALUE (@UKCountryId, "TOF", "Torfaen"), (@UKCountryId, "VGL", "Vale of Glamorgan, The"), (@UKCountryId, "WRX", "Wrexham"); + +ALTER TABLE civicrm_price_set MODIFY COLUMN `min_amount` decimal(20,2) DEFAULT '0.00' COMMENT 'Minimum Amount required for this set.'; diff --git a/xml/schema/Price/PriceSet.xml b/xml/schema/Price/PriceSet.xml index d84ac53392..4e995b9b33 100644 --- a/xml/schema/Price/PriceSet.xml +++ b/xml/schema/Price/PriceSet.xml @@ -185,8 +185,8 @@ min_amount Minimum Amount - int unsigned - 0 + decimal + 0.0 Minimum Amount required for this set. 4.7 -- 2.25.1