Skip to content

Commit

Permalink
refs #39632, gh-111, add sync fields to Group class and DB schema
Browse files Browse the repository at this point in the history
  • Loading branch information
poliphilochu committed Jan 16, 2024
1 parent 7c656bc commit ef44145
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
33 changes: 33 additions & 0 deletions CRM/Contact/DAO/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,24 @@ class CRM_Contact_DAO_Group extends CRM_Core_DAO
* @var boolean
*/
public $is_hidden;
/**
* Indicates whether the group is synchronized.
*
* @var boolean
*/
public $is_sync;
/**
* Stores JSON format data from the remote group, such as remote group ID, name, creation time.
*
* @var blob
*/
public $sync_data;
/**
* Stores the last sync time with the remote group.
*
* @var datetime
*/
public $last_sync;
/**
* class constructor
*
Expand Down Expand Up @@ -321,6 +339,21 @@ static function &fields()
'name' => 'is_hidden',
'type' => CRM_Utils_Type::T_BOOLEAN,
) ,
'is_sync' => array(
'name' => 'is_sync',
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => ts('Is Sync') ,
) ,
'sync_data' => array(
'name' => 'sync_data',
'type' => CRM_Utils_Type::T_BLOB,
'title' => ts('Sync Data') ,
) ,
'last_sync' => array(
'name' => 'last_sync',
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => ts('Last Sync') ,
) ,
);
}
return self::$_fields;
Expand Down
3 changes: 3 additions & 0 deletions sql/civicrm.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -3296,6 +3296,9 @@ CREATE TABLE civicrm_group (
parents text COMMENT 'IDs of the parent(s)',
children text COMMENT 'IDs of the child(ren)',
is_hidden tinyint DEFAULT 0 COMMENT 'Is this group hidden?'
is_sync tinyint COMMENT 'Indicates whether the group is synchronized.'
sync_data blob COMMENT 'Stores JSON format data from the remote group, such as remote group ID, name, creation time.'
last_sync datetime COMMENT 'Stores the last sync time with the remote group.'
,
PRIMARY KEY ( id )

Expand Down
18 changes: 18 additions & 0 deletions xml/schema/Contact/Group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,24 @@
<comment>Is this group hidden?</comment>
<add>2.2</add>
</field>
<field>
<name>is_sync</name>
<type>boolean</type>
<comment>Indicates whether the group is synchronized.</comment>
<add>7.0</add>
</field>
<field>
<name>sync_data</name>
<type>blob</type>
<comment>Stores JSON format data from the remote group, such as remote group ID, name, creation time.</comment>
<add>7.0</add>
</field>
<field>
<name>last_sync</name>
<type>datetime</type>
<comment>Stores the last sync time with the remote group.</comment>
<add>7.0</add>
</field>
<index>
<name>index_group_type</name>
<fieldName>group_type</fieldName>
Expand Down

0 comments on commit ef44145

Please sign in to comment.