Answers.Body: <p><code>civicrm_subscription_history</code> is only minimally exposed in the core UI - but there is a <a href="https://github.com/MegaphoneJon/org.cpehn.subscriptionhistory" rel="nofollow noreferrer">Subscription History Report</a> extension on my Github that you can use which exposes it to CiviReports.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-11T20:58:58.130Z
Answers.LastActivityDate: 2017-10-11T20:58:58.130Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>It is used in as far as when you look at the Groups tab it is the source of data for the date field displayed.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-10T22:37:06.963Z
Answers.Text: As per my comment above, this actually seems to be stored in the group_contact table (along with normal group memberships).
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-11T01:54:50.440Z
Answers.Text: Okay but Group Contact table doesn't have a date field. So on the Group Tab when you see eg Date Added - isn't that coming from this subs table?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-11T06:26:55.923Z
Answers.Text: yes it is indeed pete!
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-11T07:52:59.470Z
Answers.Text: Yes, that's right, found it in here: \CRM_Contact_BAO_GroupContact::getContactGroup
  
  Thanks
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-11T18:14:51.627Z
Answers.Text: modified (as in totally changed) the answer to focus on the 'date' aspect in case it encourages you to tick or +1 it and keep SE happy so it doesn't keep bumping back up the list as 'doesn't have an accepted answer'
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-10T18:34:22.453Z
Answers.LastActivityDate: 2017-10-11T18:13:50.733Z
Answers.LastEditDate: 2017-10-11T18:13:50.733Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>The subscription history is shown in the Group tab of the Contact summary in as much as you can see Groups people 'were' in.</p>
  
  <p>The the civicrm_group_contact table stores that people are 'removed' from the group, but the date that it happened is pulled from civicrm_subscription_history (as part of this function: \CRM_Contact_BAO_GroupContact::getContactGroup).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-10T22:30:23.407Z
Answers.Text: If you remove a contact from a group then it is still stored in the 'civicrm_group_contact' table. The status just changes from 'Added' to 'Removed'. I didn't think the tab was actually looking at the _subscription_history?
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-10T22:36:31.533Z
Answers.Text: To confirm, here's the code that's looking in the group_contact table to get the people who have been 'removed': https://github.com/civicrm/civicrm-core/blob/8408c6a7ad1f180db51e5528da50027eaa19be59/CRM/Contact/Page/View/GroupContact.php#L44
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-10T14:59:14.963Z
Answers.LastActivityDate: 2017-10-11T07:54:07.017Z
Answers.LastEditDate: 2017-10-11T07:54:07.017Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>CiviCRM has a table called civicrm_subscription_history. This table stores a log of each time a contact is added, removed, or deleted from a group. That's cool. It seems to be reliable (tied in to the groupContact BAOs), and is even used with the role sync Drupal module too.</p>
  
  <p>But, it doesn't seem to be 'used' anywhere? The information in the subscription history is never exposed to the front end? It seems to be just an ever-growing list of history that most users will never know exists.</p>
  
  <p>The follow-up questions would be (if indeed it isn't exposed anywhere), should we:</p>
  
  <ul>
  <li>Create a feature request to be able to turn the functionality on/off?</li>
  <li>Create a feature request to expose it via a UI in core?</li>
  <li>Create an extension that exposes it via a UI?</li>
  <li>Copy out the code into an extension, with a UI that exposes it (and eventually deprecate it from core)?</li>
  <li>Leave it alone? (Our table has 9 million rows though...)</li>
  </ul>
  
  <p>It feels like a loose-end at the moment.</p>
  
  <p>Edit: I notice it <strong>is</strong> exposed by the new GDPR extension from Veda Consulting.</p>
  
Tags: <groups><logs>
Title: Where is the 'subscription history' exposed?
ThreadText: # Where is the 'subscription history' exposed?
  
  (Asked by: username_0 on 2017-10-10)
  
  CiviCRM has a table called civicrm\_subscription\_history. This table stores a log of each time a contact is added, removed, or deleted from a group. That's cool. It seems to be reliable (tied in to the groupContact BAOs), and is even used with the role sync Drupal module too.
  
  But, it doesn't seem to be 'used' anywhere? The information in the subscription history is never exposed to the front end? It seems to be just an ever-growing list of history that most users will never know exists.
  
  The follow-up questions would be (if indeed it isn't exposed anywhere), should we:
  
  * Create a feature request to be able to turn the functionality on/off?
  * Create a feature request to expose it via a UI in core?
  * Create an extension that exposes it via a UI?
  * Copy out the code into an extension, with a UI that exposes it (and eventually deprecate it from core)?
  * Leave it alone? (Our table has 9 million rows though...)
  
  It feels like a loose-end at the moment.
  
  Edit: I notice it **is** exposed by the new GDPR extension from Veda Consulting.
  
  **Tags:** groups, logs
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2017-10-10. Score: 3 | Accepted answer
  
  The subscription history is shown in the Group tab of the Contact summary in as much as you can see Groups people 'were' in.
  
  The the civicrm\_group\_contact table stores that people are 'removed' from the group, but the date that it happened is pulled from civicrm\_subscription\_history (as part of this function: \CRM\_Contact\_BAO\_GroupContact::getContactGroup).
  
  > **Comments:**
  > **username_0**: If you remove a contact from a group then it is still stored in the 'civicrm_group_contact' table. The status just changes from 'Added' to 'Removed'. I didn't think the tab was actually looking at the _subscription_history?  
  > **username_0**: To confirm, here's the code that's looking in the group_contact table to get the people who have been 'removed': https://github.com/civicrm/civicrm-core/blob/8408c6a7ad1f180db51e5528da50027eaa19be59/CRM/Contact/Page/View/GroupContact.php#L44  
  
  ---
  
  ### Answer by username_1 on 2017-10-11. Score: 1
  
  `civicrm_subscription_history` is only minimally exposed in the core UI - but there is a [Subscription History Report](https://github.com/MegaphoneJon/org.cpehn.subscriptionhistory) extension on my Github that you can use which exposes it to CiviReports.
  
  
  ---
  
  ### Answer by username_2 on 2017-10-10. Score: 0
  
  It is used in as far as when you look at the Groups tab it is the source of data for the date field displayed.
  
  > **Comments:**
  > **username_0**: As per my comment above, this actually seems to be stored in the group_contact table (along with normal group memberships).  
  > **username_2**: Okay but Group Contact table doesn't have a date field. So on the Group Tab when you see eg Date Added - isn't that coming from this subs table?  
  > **username_3**: yes it is indeed pete!  
  > **username_0**: Yes, that's right, found it in here: \CRM_Contact_BAO_GroupContact::getContactGroup  Thanks  
  > **username_2**: modified (as in totally changed) the answer to focus on the 'date' aspect in case it encourages you to tick or +1 it and keep SE happy so it doesn't keep bumping back up the list as 'doesn't have an accepted answer'  
  
  ---
  
  