CRM-13497 - getting there on main tables
[civicrm-core.git] / xml / schema / Event / Participant.xml
CommitLineData
3c7d2158 1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Event</base>
5 <class>Participant</class>
6 <name>civicrm_participant</name>
7 <add>1.7</add>
6a488035 8 <log>true</log>
3c7d2158 9 <field>
10 <name>id</name>
11 <uniqueName>participant_id</uniqueName>
6a488035 12 <title>Participant ID</title>
3c7d2158 13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>Participant Id</comment>
6a488035
TO
16 <import>true</import>
17 <headerPattern>/(^(participant(.)?)?id$)/i</headerPattern>
3c7d2158 18 <add>1.7</add>
19 </field>
20 <primaryKey>
21 <name>id</name>
22 <autoincrement>true</autoincrement>
23 </primaryKey>
24 <field>
6a488035 25 <name>contact_id</name>
3c7d2158 26 <uniqueName>participant_contact_id</uniqueName>
27 <type>int unsigned</type>
6a488035
TO
28 <title>Contact ID</title>
29 <headerPattern>/contact(.?id)?/i</headerPattern>
30 <import>true</import>
b081c5df 31 <required>true</required>
3c7d2158 32 <comment>FK to Contact ID</comment>
33 <add>1.7</add>
6a488035 34 </field>
3c7d2158 35 <foreignKey>
36 <name>contact_id</name>
37 <table>civicrm_contact</table>
38 <key>id</key>
6a488035
TO
39 <onDelete>CASCADE</onDelete>
40 </foreignKey>
3c7d2158 41 <field>
42 <name>event_id</name>
43 <type>int unsigned</type>
6a488035
TO
44 <title>Event</title>
45 <import>true</import>
46 <headerPattern>/event id$/i</headerPattern>
b081c5df 47 <required>true</required>
3c7d2158 48 <comment>FK to Event ID</comment>
49 <add>1.7</add>
6a488035 50 </field>
3c7d2158 51 <foreignKey>
52 <name>event_id</name>
53 <table>civicrm_event</table>
54 <key>id</key>
6a488035
TO
55 <onDelete>CASCADE</onDelete>
56 </foreignKey>
3c7d2158 57 <field>
58 <name>status_id</name>
6a488035
TO
59 <uniqueName>participant_status_id</uniqueName>
60 <title>Participant Status Id</title>
61 <headerPattern>/(participant.)?(status)$/i</headerPattern>
62 <import>true</import>
63 <type>int unsigned</type>
64 <export>false</export>
3c7d2158 65 <required>true</required>
6a488035
TO
66 <default>1</default>
67 <comment>Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.</comment>
3c7d2158 68 <add>1.7</add>
6a488035 69 <pseudoconstant>
2158332a 70 <table>civicrm_participant_status_type</table>
6a488035 71 <keyColumn>id</keyColumn>
a38a89fc 72 <labelColumn>label</labelColumn>
6a488035 73 </pseudoconstant>
614d72ec 74 <html>
75 <type>Select></type>
76 </html>
6a488035
TO
77 </field>
78 <foreignKey>
79 <name>status_id</name>
80 <table>civicrm_participant_status_type</table>
81 <key>id</key>
82 <add>3.0</add>
83 </foreignKey>
84 <index>
85 <name>index_status_id</name>
86 <fieldName>status_id</fieldName>
87 <add>1.8</add>
88 </index>
3c7d2158 89 <field>
90 <name>role_id</name>
6a488035
TO
91 <uniqueName>participant_role_id</uniqueName>
92 <title>Participant Role Id</title>
93 <pseudoconstant>
6a488035 94 <optionGroupName>participant_role</optionGroupName>
6a488035 95 </pseudoconstant>
614d72ec 96 <html>
97 <type>Select></type>
98 </html>
6a488035
TO
99 <headerPattern>/(participant.)?(role)$/i</headerPattern>
100 <import>true</import>
3c7d2158 101 <type>varchar</type>
102 <length>128</length>
6a488035
TO
103 <export>false</export>
104 <default>NULL</default>
3c7d2158 105 <comment>Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.</comment>
106 <add>1.7</add>
6a488035
TO
107 </field>
108 <index>
109 <name>index_role_id</name>
110 <fieldName>role_id</fieldName>
111 <add>1.8</add>
112 </index>
3c7d2158 113 <field>
6a488035
TO
114 <name>register_date</name>
115 <uniqueName>participant_register_date</uniqueName>
116 <title>Register date</title>
117 <headerPattern>/^(r(egister\s)?date)$/i</headerPattern>
118 <import>true</import>
3c7d2158 119 <type>datetime</type>
6a488035 120 <comment>When did contact register for event?</comment>
3c7d2158 121 <add>1.7</add>
6a488035
TO
122 </field>
123 <field>
124 <name>source</name>
125 <uniqueName>participant_source</uniqueName>
3c7d2158 126 <title>Participant Source</title>
6a488035
TO
127 <headerPattern>/(participant.)?(source)$/i</headerPattern>
128 <import>true</import>
3c7d2158 129 <type>varchar</type>
130 <length>128</length>
6a488035 131 <comment>Source of this event registration.</comment>
3c7d2158 132 <add>1.7</add>
133 </field>
134 <field>
6a488035
TO
135 <name>fee_level</name>
136 <uniqueName>participant_fee_level</uniqueName>
137 <title>Fee level</title>
138 <headerPattern>/^(f(ee\s)?level)$/i</headerPattern>
3c7d2158 139 <type>text</type>
6a488035
TO
140 <import>true</import>
141 <comment>Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that we store the label value and not the key</comment>
3c7d2158 142 <add>1.7</add>
143 </field>
144 <field>
145 <name>is_test</name>
146 <uniqueName>participant_is_test</uniqueName>
6a488035
TO
147 <title>Test</title>
148 <type>boolean</type>
149 <default>0</default>
150 <import>true</import>
3c7d2158 151 <add>1.7</add>
6a488035 152 </field>
3c7d2158 153 <field>
154 <name>is_pay_later</name>
155 <uniqueName>participant_is_pay_later</uniqueName>
6a488035
TO
156 <title>Is Pay Later</title>
157 <type>boolean</type>
158 <default>0</default>
159 <import>true</import>
160 <headerPattern>/(is.)?(pay(.)?later)$/i</headerPattern>
3c7d2158 161 <add>2.1</add>
6a488035 162 </field>
3c7d2158 163
164 <field>
6a488035
TO
165 <name>fee_amount</name>
166 <uniqueName>participant_fee_amount</uniqueName>
167 <title>Fee Amount</title>
168 <type>decimal</type>
169 <import>true</import>
170 <headerPattern>/fee(.?am(ou)?nt)?/i</headerPattern>
171 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
172 <comment>actual processor fee if known - may be 0.</comment>
3c7d2158 173 <add>2.1</add>
174 </field>
175 <field>
6a488035 176 <name>registered_by_id</name>
3c7d2158 177 <uniqueName>participant_registered_by_id</uniqueName>
178 <type>int unsigned</type>
6a488035
TO
179 <title>Registered By ID</title>
180 <import>true</import>
181 <default>NULL</default>
3c7d2158 182 <comment>FK to Participant ID</comment>
183 <add>2.1</add>
6a488035
TO
184 <export>true</export>
185 </field>
3c7d2158 186 <foreignKey>
187 <name>registered_by_id</name>
188 <table>civicrm_participant</table>
189 <key>id</key>
190 <add>2.1</add>
6a488035 191 <onDelete>SET NULL</onDelete>
3c7d2158 192 </foreignKey>
193 <field>
6a488035
TO
194 <name>discount_id</name>
195 <uniqueName>participant_discount_id</uniqueName>
3c7d2158 196 <type>int unsigned</type>
6a488035
TO
197 <title>Discount ID</title>
198 <default>NULL</default>
199 <comment>FK to Discount ID</comment>
200 <add>2.1</add>
201 </field>
3c7d2158 202 <foreignKey>
203 <name>discount_id</name>
204 <table>civicrm_discount</table>
205 <key>id</key>
206 <add>2.1</add>
6a488035 207 <onDelete>SET NULL</onDelete>
3c7d2158 208 </foreignKey>
209 <field>
6a488035
TO
210 <name>fee_currency</name>
211 <uniqueName>participant_fee_currency</uniqueName>
212 <title>Fee Currency</title>
213 <type>varchar</type>
214 <length>3</length>
215 <default>NULL</default>
216 <import>true</import>
217 <headerPattern>/(fee)?.?cur(rency)?/i</headerPattern>
218 <dataPattern>/^[A-Z]{3}$/i</dataPattern>
219 <comment>3 character string, value derived from config setting.</comment>
220 <add>3.0</add>
bd44e0df
AS
221 <pseudoconstant>
222 <table>civicrm_currency</table>
223 <keyColumn>name</keyColumn>
a38a89fc
CW
224 <labelColumn>full_name</labelColumn>
225 <nameColumn>numeric_code</nameColumn>
bd44e0df 226 </pseudoconstant>
614d72ec 227 <html>
228 <type>Select></type>
229 </html>
6a488035 230 </field>
3c7d2158 231 <field>
232 <name>campaign_id</name>
6a488035
TO
233 <uniqueName>participant_campaign_id</uniqueName>
234 <type>int unsigned</type>
235 <title>Campaign ID</title>
3c7d2158 236 <import>true</import>
237 <comment>The campaign for which this participant has been registered.</comment>
238 <add>3.4</add>
239 </field>
240 <foreignKey>
241 <name>campaign_id</name>
242 <table>civicrm_campaign</table>
243 <key>id</key>
6a488035
TO
244 <onDelete>SET NULL</onDelete>
245 </foreignKey>
246 <field>
247 <name>discount_amount</name>
248 <type>int unsigned</type>
249 <title>Discount Amount</title>
250 <comment>Discount Amount</comment>
251 <add>4.1</add>
252 </field>
253 <field>
254 <name>cart_id</name>
255 <type>int unsigned</type>
256 <title>Event Cart ID</title>
257 <comment>FK to civicrm_event_carts</comment>
258 <add>4.1</add>
259 </field>
260 <foreignKey>
261 <name>cart_id</name>
262 <table>civicrm_event_carts</table>
263 <key>id</key>
264 <onDelete>SET NULL</onDelete>
265 </foreignKey>
266 <field>
267 <name>must_wait</name>
268 <type>int</type>
269 <title>Must Wait on List</title>
270 <comment>On Waiting List</comment>
271 <add>4.1</add>
272 </field>
273</table>