From 2b2164791c945cfe6fabcb119696a5a46816f16f Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Tue, 21 Aug 2018 16:20:35 +0100 Subject: [PATCH] Foreign key for civicrm_option_group.option_group_id --- CRM/Core/DAO/CustomField.php | 4 +++- xml/schema/Core/CustomField.xml | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CRM/Core/DAO/CustomField.php b/CRM/Core/DAO/CustomField.php index fea2e7e4c7..cda6a54a25 100644 --- a/CRM/Core/DAO/CustomField.php +++ b/CRM/Core/DAO/CustomField.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/CustomField.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7f096c92af68ef9564675e3d708fbbe1) + * (GenCodeChecksum:73d7ccebba6055cae4fa0c9d797025c4) */ /** @@ -256,6 +256,7 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { if (!isset(Civi::$statics[__CLASS__]['links'])) { Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'custom_group_id', 'civicrm_custom_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'option_group_id', 'civicrm_option_group', 'id'); CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); } return Civi::$statics[__CLASS__]['links']; @@ -598,6 +599,7 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { 'entity' => 'CustomField', 'bao' => 'CRM_Core_BAO_CustomField', 'localizable' => 0, + 'FKClassName' => 'CRM_Core_DAO_OptionGroup', 'pseudoconstant' => [ 'table' => 'civicrm_option_group', 'keyColumn' => 'id', diff --git a/xml/schema/Core/CustomField.xml b/xml/schema/Core/CustomField.xml index 8d81309544..dfbfa5a021 100644 --- a/xml/schema/Core/CustomField.xml +++ b/xml/schema/Core/CustomField.xml @@ -268,6 +268,13 @@ title + + option_group_id + civicrm_option_group
+ id + 5.3 + SET NULL +
filter varchar -- 2.25.1