Merge pull request #7797 from JKingsnorth/CRM-17977
[civicrm-core.git] / xml / schema / Contact / SubscriptionHistory.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contact</base>
5 <class>SubscriptionHistory</class>
6 <name>civicrm_subscription_history</name>
7 <comment>History information of subscribe/unsubscribe actions</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <title>Group Membership History ID</title>
13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>Internal Id</comment>
16 <add>1.1</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
23 <name>contact_id</name>
24 <title>Contact ID</title>
25 <type>int unsigned</type>
26 <required>true</required>
27 <comment>Contact Id</comment>
28 <add>1.1</add>
29 </field>
30 <foreignKey>
31 <name>contact_id</name>
32 <table>civicrm_contact</table>
33 <key>id</key>
34 <add>1.1</add>
35 <onDelete>CASCADE</onDelete>
36 </foreignKey>
37 <field>
38 <name>group_id</name>
39 <title>Group</title>
40 <type>int unsigned</type>
41 <comment>Group Id</comment>
42 <add>1.1</add>
43 <pseudoconstant>
44 <table>civicrm_group</table>
45 <keyColumn>id</keyColumn>
46 <labelColumn>title</labelColumn>
47 </pseudoconstant>
48 <html>
49 <type>Select</type>
50 </html>
51 </field>
52 <foreignKey>
53 <name>group_id</name>
54 <table>civicrm_group</table>
55 <key>id</key>
56 <add>1.1</add>
57 <onDelete>CASCADE</onDelete>
58 </foreignKey>
59 <field>
60 <name>date</name>
61 <title>Group Membership Action Date</title>
62 <type>datetime</type>
63 <required>true</required>
64 <comment>Date of the (un)subscription</comment>
65 <add>1.1</add>
66 </field>
67 <field>
68 <name>method</name>
69 <title>Group Membership Action</title>
70 <type>varchar</type>
71 <length>8</length>
72 <comment>How the (un)subscription was triggered</comment>
73 <pseudoconstant>
74 <callback>CRM_Core_SelectValues::getSubscriptionHistoryMethods</callback>
75 </pseudoconstant>
76 <add>1.1</add>
77 <html>
78 <type>Select</type>
79 </html>
80 </field>
81 <field>
82 <name>status</name>
83 <title>Group Membership Status</title>
84 <type>varchar</type>
85 <length>8</length>
86 <comment>The state of the contact within the group</comment>
87 <pseudoconstant>
88 <callback>CRM_Core_SelectValues::groupContactStatus</callback>
89 </pseudoconstant>
90 <add>1.1</add>
91 </field>
92 <field>
93 <name>tracking</name>
94 <title>Group Membership Tracking</title>
95 <type>varchar</type>
96 <length>255</length>
97 <comment>IP address or other tracking info</comment>
98 <add>1.1</add>
99 </field>
100 </table>