Skip to content

Commit

Permalink
Merge pull request #12706 from pradpnayak/OptionGroupFK
Browse files Browse the repository at this point in the history
Foreign key for civicrm_custom_field.option_group_id
  • Loading branch information
colemanw authored Aug 29, 2018
2 parents 6df07ae + febf277 commit 72ea63d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRM/Core/DAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/CustomField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:7f096c92af68ef9564675e3d708fbbe1)
* (GenCodeChecksum:73d7ccebba6055cae4fa0c9d797025c4)
*/

/**
Expand Down Expand Up @@ -256,6 +256,7 @@ public static function getReferenceColumns() {
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'];
Expand Down Expand Up @@ -598,6 +599,7 @@ public static function &fields() {
'entity' => 'CustomField',
'bao' => 'CRM_Core_BAO_CustomField',
'localizable' => 0,
'FKClassName' => 'CRM_Core_DAO_OptionGroup',
'pseudoconstant' => [
'table' => 'civicrm_option_group',
'keyColumn' => 'id',
Expand Down
7 changes: 7 additions & 0 deletions xml/schema/Core/CustomField.xml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@
<labelColumn>title</labelColumn>
</pseudoconstant>
</field>
<foreignKey>
<name>option_group_id</name>
<table>civicrm_option_group</table>
<key>id</key>
<add>5.6</add>
<onDelete>SET NULL</onDelete>
</foreignKey>
<field>
<name>filter</name>
<type>varchar</type>
Expand Down

0 comments on commit 72ea63d

Please sign in to comment.