Skip to content
Snippets Groups Projects
Commit ce945da5 authored by totten's avatar totten
Browse files

RelationshipCache - Remove case_id

parent bcf70e08
Branches
Tags
No related merge requests found
......@@ -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',
],
];
......
......@@ -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']);
}
......
......@@ -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'];
......
......@@ -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;
......@@ -183,20 +183,4 @@
<formatType>activityDate</formatType>
</html>
</field>
<field>
<name>case_id</name>
<type>int unsigned</type>
<title>Relationship Case</title>
<default>NULL</default>
<comment>FK to civicrm_case</comment>
<add>5.29</add>
</field>
<foreignKey>
<name>case_id</name>
<table>civicrm_case</table>
<key>id</key>
<add>5.29</add>
<onDelete>CASCADE</onDelete>
</foreignKey>
</table>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment