From: Monish Deb Date: Fri, 8 Apr 2022 01:12:17 +0000 (-0700) Subject: Schema - Fix boolean fields in 'Report' X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=df72de7c27ebcb358a45936f796a2fea7ab7683b;p=civicrm-core.git Schema - Fix boolean fields in 'Report' --- diff --git a/CRM/Report/DAO/ReportInstance.php b/CRM/Report/DAO/ReportInstance.php index f5ce8c7171..69b1eac776 100644 --- a/CRM/Report/DAO/ReportInstance.php +++ b/CRM/Report/DAO/ReportInstance.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Report/ReportInstance.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:0cc1db696d0899940ac62d266cb55a0a) + * (GenCodeChecksum:588c8712caae98e6765ac8ed21c9e6b2) */ /** @@ -131,7 +131,7 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO { /** * Is this entry active? * - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -219,7 +219,7 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO { public $drilldown_id; /** - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -449,7 +449,9 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Report Instance is Active'), 'description' => ts('Is this entry active?'), + 'required' => TRUE, 'where' => 'civicrm_report_instance.is_active', + 'default' => '1', 'table_name' => 'civicrm_report_instance', 'entity' => 'ReportInstance', 'bao' => 'CRM_Report_BAO_ReportInstance', @@ -612,6 +614,7 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO { 'name' => 'is_reserved', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Instance is Reserved'), + 'required' => TRUE, 'where' => 'civicrm_report_instance.is_reserved', 'default' => '0', 'table_name' => 'civicrm_report_instance', diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine/Report.bool.php b/CRM/Upgrade/Incremental/php/FiveFortyNine/Report.bool.php new file mode 100644 index 0000000000..545e3ede8e --- /dev/null +++ b/CRM/Upgrade/Incremental/php/FiveFortyNine/Report.bool.php @@ -0,0 +1,11 @@ + [ + 'is_active' => "DEFAULT 0 COMMENT 'Is this entry active?'", + 'is_reserved' => "DEFAULT 0", + ], + 'civicrm_report_instance' => [ + 'is_active' => "DEFAULT 1 COMMENT 'Is this entry active?'", + ], + // WTF +]; diff --git a/xml/schema/Report/ReportInstance.xml b/xml/schema/Report/ReportInstance.xml index e020ec3149..58cf3b8c4d 100644 --- a/xml/schema/Report/ReportInstance.xml +++ b/xml/schema/Report/ReportInstance.xml @@ -137,6 +137,8 @@ is_active Report Instance is Active boolean + 1 + true Is this entry active? CheckBox @@ -272,6 +274,7 @@ Instance is Reserved boolean 0 + true CheckBox