From ce945da59ff8a9adc2088275689a615945e3015e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 16 Jul 2020 00:34:01 -0700 Subject: [PATCH] RelationshipCache - Remove case_id --- CRM/Contact/BAO/RelationshipCache.php | 2 -- CRM/Contact/DAO/RelationshipCache.php | 24 +------------------ .../Incremental/php/FiveTwentyNine.php | 2 -- .../Incremental/sql/5.29.alpha1.mysql.tpl | 4 +--- xml/schema/Contact/RelationshipCache.xml | 16 ------------- 5 files changed, 2 insertions(+), 46 deletions(-) diff --git a/CRM/Contact/BAO/RelationshipCache.php b/CRM/Contact/BAO/RelationshipCache.php index 686fc0a351..edb76cd1db 100644 --- a/CRM/Contact/BAO/RelationshipCache.php +++ b/CRM/Contact/BAO/RelationshipCache.php @@ -33,7 +33,6 @@ class CRM_Contact_BAO_RelationshipCache extends CRM_Contact_DAO_RelationshipCach 'start_date' => 'rel.start_date', 'end_date' => 'rel.end_date', 'is_active' => 'rel.is_active', - 'case_id' => 'rel.case_id', ], 'b_a' => [ 'relationship_id' => 'rel.id', @@ -46,7 +45,6 @@ class CRM_Contact_BAO_RelationshipCache extends CRM_Contact_DAO_RelationshipCach 'start_date' => 'rel.start_date', 'end_date' => 'rel.end_date', 'is_active' => 'rel.is_active', - 'case_id' => 'rel.case_id', ], ]; diff --git a/CRM/Contact/DAO/RelationshipCache.php b/CRM/Contact/DAO/RelationshipCache.php index f79fd1ee67..5b8f62cb2f 100644 --- a/CRM/Contact/DAO/RelationshipCache.php +++ b/CRM/Contact/DAO/RelationshipCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/RelationshipCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:082fd4d2b313bc1928f56da80a620582) + * (GenCodeChecksum:6a586a5a5550a64db4c9907387c1411d) */ /** @@ -112,13 +112,6 @@ class CRM_Contact_DAO_RelationshipCache extends CRM_Core_DAO { */ public $end_date; - /** - * FK to civicrm_case - * - * @var int - */ - public $case_id; - /** * Class constructor. */ @@ -147,7 +140,6 @@ class CRM_Contact_DAO_RelationshipCache extends CRM_Core_DAO { Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'relationship_type_id', 'civicrm_relationship_type', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'near_contact_id', 'civicrm_contact', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'far_contact_id', 'civicrm_contact', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'case_id', 'civicrm_case', 'id'); CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); } return Civi::$statics[__CLASS__]['links']; @@ -324,20 +316,6 @@ class CRM_Contact_DAO_RelationshipCache extends CRM_Core_DAO { ], 'add' => '5.29', ], - 'case_id' => [ - 'name' => 'case_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Relationship Case'), - 'description' => ts('FK to civicrm_case'), - 'where' => 'civicrm_relationship_cache.case_id', - 'default' => 'NULL', - 'table_name' => 'civicrm_relationship_cache', - 'entity' => 'RelationshipCache', - 'bao' => 'CRM_Contact_BAO_RelationshipCache', - 'localizable' => 0, - 'FKClassName' => 'CRM_Case_DAO_Case', - 'add' => '5.29', - ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } diff --git a/CRM/Upgrade/Incremental/php/FiveTwentyNine.php b/CRM/Upgrade/Incremental/php/FiveTwentyNine.php index f384a5f57a..74395e7219 100644 --- a/CRM/Upgrade/Incremental/php/FiveTwentyNine.php +++ b/CRM/Upgrade/Incremental/php/FiveTwentyNine.php @@ -130,7 +130,6 @@ class CRM_Upgrade_Incremental_php_FiveTwentyNine extends CRM_Upgrade_Incremental 'start_date' => 'rel.start_date', 'end_date' => 'rel.end_date', 'is_active' => 'rel.is_active', - 'case_id' => 'rel.case_id', ], 'b_a' => [ 'relationship_id' => 'rel.id', @@ -143,7 +142,6 @@ class CRM_Upgrade_Incremental_php_FiveTwentyNine extends CRM_Upgrade_Incremental 'start_date' => 'rel.start_date', 'end_date' => 'rel.end_date', 'is_active' => 'rel.is_active', - 'case_id' => 'rel.case_id', ], ]; $keyFields = ['relationship_id', 'orientation']; diff --git a/CRM/Upgrade/Incremental/sql/5.29.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.29.alpha1.mysql.tpl index 3483c5ebde..7508dec80c 100644 --- a/CRM/Upgrade/Incremental/sql/5.29.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.29.alpha1.mysql.tpl @@ -14,7 +14,6 @@ CREATE TABLE `civicrm_relationship_cache` ( `is_active` tinyint DEFAULT 1 COMMENT 'is the relationship active ?', `start_date` date COMMENT 'date when the relationship started', `end_date` date COMMENT 'date when the relationship ended', - `case_id` int unsigned DEFAULT NULL COMMENT 'FK to civicrm_case', PRIMARY KEY (`id`), UNIQUE INDEX `UI_relationship`(relationship_id, orientation), INDEX `index_nearid_nearrelation`(near_contact_id, near_relation), @@ -23,6 +22,5 @@ CREATE TABLE `civicrm_relationship_cache` ( CONSTRAINT FK_civicrm_relationship_cache_relationship_id FOREIGN KEY (`relationship_id`) REFERENCES `civicrm_relationship`(`id`) ON DELETE CASCADE, CONSTRAINT FK_civicrm_relationship_cache_relationship_type_id FOREIGN KEY (`relationship_type_id`) REFERENCES `civicrm_relationship_type`(`id`) ON DELETE CASCADE, CONSTRAINT FK_civicrm_relationship_cache_near_contact_id FOREIGN KEY (`near_contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE, - CONSTRAINT FK_civicrm_relationship_cache_far_contact_id FOREIGN KEY (`far_contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE, - CONSTRAINT FK_civicrm_relationship_cache_case_id FOREIGN KEY (`case_id`) REFERENCES `civicrm_case`(`id`) ON DELETE CASCADE + CONSTRAINT FK_civicrm_relationship_cache_far_contact_id FOREIGN KEY (`far_contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; diff --git a/xml/schema/Contact/RelationshipCache.xml b/xml/schema/Contact/RelationshipCache.xml index 3c80d0e183..e522e4588b 100644 --- a/xml/schema/Contact/RelationshipCache.xml +++ b/xml/schema/Contact/RelationshipCache.xml @@ -183,20 +183,4 @@ activityDate - - - case_id - int unsigned - Relationship Case - NULL - FK to civicrm_case - 5.29 - - - case_id - civicrm_case
- id - 5.29 - CASCADE -
-- 2.25.1