From 60a5e8208baccc6a93ebe49831fcb2a84b39b218 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 13 Mar 2017 21:27:28 -0400 Subject: [PATCH] CRM-20102 - make case_type_id required --- CRM/Case/DAO/Case.php | 3 ++- CRM/Core/DAO/AllCoreTables.data.php | 2 +- CRM/Upgrade/Incremental/sql/4.7.18.mysql.tpl | 5 +++++ xml/schema/Case/Case.xml | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CRM/Case/DAO/Case.php b/CRM/Case/DAO/Case.php index f8bea69025..3dbf2057dc 100644 --- a/CRM/Case/DAO/Case.php +++ b/CRM/Case/DAO/Case.php @@ -30,7 +30,7 @@ * * Generated from xml/schema/CRM/Case/Case.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:44b646374975b3c38e6619c07369162c) + * (GenCodeChecksum:1291e7482bee7a47f020de128e9587f7) */ require_once 'CRM/Core/DAO.php'; require_once 'CRM/Utils/Type.php'; @@ -146,6 +146,7 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Case Type') , 'description' => 'FK to civicrm_case_type.id', + 'required' => true, 'import' => true, 'where' => 'civicrm_case.case_type_id', 'headerPattern' => '', diff --git a/CRM/Core/DAO/AllCoreTables.data.php b/CRM/Core/DAO/AllCoreTables.data.php index 8282834d46..d7df779ef5 100644 --- a/CRM/Core/DAO/AllCoreTables.data.php +++ b/CRM/Core/DAO/AllCoreTables.data.php @@ -24,7 +24,7 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ */ -// (GenCodeChecksum:b66a5c6ab79bec53c7781738c148e525) +// (GenCodeChecksum:cc2bcf9042dba71a302a4072f41762cc) return array( 'CRM_Core_DAO_AddressFormat' => array( 'name' => 'AddressFormat', diff --git a/CRM/Upgrade/Incremental/sql/4.7.18.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.18.mysql.tpl index a5cf38f85d..d2ebea11ad 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.18.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.18.mysql.tpl @@ -69,6 +69,11 @@ UPDATE `civicrm_state_province` SET `name`='Yunlin County' WHERE `name` = 'Yunli UPDATE `civicrm_country` SET `name`='Palestine, State of' WHERE `name` = 'Palestinian Territory'; UPDATE `civicrm_country` SET `name`='Virgin Islands, British' WHERE `name` = 'Virgin Islands,British'; +-- CRM-20102 make case_type_id required +ALTER TABLE `civicrm_case` DROP FOREIGN KEY `FK_civicrm_case_case_type_id`; +ALTER TABLE `civicrm_case` MODIFY `case_type_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_case_type.id'; +ALTER TABLE `civicrm_case` ADD CONSTRAINT `FK_civicrm_case_case_type_id` FOREIGN KEY (`case_type_id`) REFERENCES `civicrm_case_type` (`id`); + --- CRM-19715 Remove Close Accounting Period code - now in an extension. DELETE FROM civicrm_navigation WHERE url = 'civicrm/admin/contribute/closeaccperiod?reset=1' AND name = 'Close Accounting Period'; diff --git a/xml/schema/Case/Case.xml b/xml/schema/Case/Case.xml index 99ccfae54b..37d1918077 100644 --- a/xml/schema/Case/Case.xml +++ b/xml/schema/Case/Case.xml @@ -43,6 +43,7 @@ true false Case Type + true FK to civicrm_case_type.id Select @@ -64,7 +65,6 @@ civicrm_case_type
id 4.5 - SET NULL casetag1_id -- 2.25.1