Merge pull request #16714 from christianwach/lab-1638
[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>timestamp</type>
63 <required>true</required>
64 <default>CURRENT_TIMESTAMP</default>
65 <comment>Date of the (un)subscription</comment>
66 <add>1.1</add>
67 </field>
68 <field>
69 <name>method</name>
70 <title>Group Membership Action</title>
71 <type>varchar</type>
72 <length>8</length>
73 <comment>How the (un)subscription was triggered</comment>
74 <pseudoconstant>
75 <callback>CRM_Core_SelectValues::getSubscriptionHistoryMethods</callback>
76 </pseudoconstant>
77 <add>1.1</add>
78 <html>
79 <type>Select</type>
80 </html>
81 </field>
82 <field>
83 <name>status</name>
84 <title>Group Membership Status</title>
85 <type>varchar</type>
86 <length>8</length>
87 <comment>The state of the contact within the group</comment>
88 <pseudoconstant>
89 <callback>CRM_Core_SelectValues::groupContactStatus</callback>
90 </pseudoconstant>
91 <add>1.1</add>
92 </field>
93 <field>
94 <name>tracking</name>
95 <title>Group Membership Tracking</title>
96 <type>varchar</type>
97 <length>255</length>
98 <comment>IP address or other tracking info</comment>
99 <add>1.1</add>
100 </field>
101 </table>