Merge pull request #21240 from civicrm/5.41
[civicrm-core.git] / xml / schema / Event / Participant.xml
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 <description>Records of contacts' attendance and roles in events.</description>
8 <add>1.7</add>
9 <log>true</log>
10 <icon>fa-ticket</icon>
11 <component>CiviEvent</component>
12 <field>
13 <name>id</name>
14 <uniqueName>participant_id</uniqueName>
15 <title>Participant ID</title>
16 <type>int unsigned</type>
17 <required>true</required>
18 <comment>Participant ID</comment>
19 <import>true</import>
20 <headerPattern>/(^(participant(.)?)?id$)/i</headerPattern>
21 <html>
22 <type>Number</type>
23 </html>
24 <add>1.7</add>
25 </field>
26 <primaryKey>
27 <name>id</name>
28 <autoincrement>true</autoincrement>
29 </primaryKey>
30 <field>
31 <name>contact_id</name>
32 <uniqueName>participant_contact_id</uniqueName>
33 <type>int unsigned</type>
34 <title>Contact ID</title>
35 <headerPattern>/contact(.?id)?/i</headerPattern>
36 <import>true</import>
37 <required>true</required>
38 <comment>FK to Contact ID</comment>
39 <html>
40 <label>Contact</label>
41 </html>
42 <add>1.7</add>
43 </field>
44 <foreignKey>
45 <name>contact_id</name>
46 <table>civicrm_contact</table>
47 <key>id</key>
48 <onDelete>CASCADE</onDelete>
49 </foreignKey>
50 <field>
51 <name>event_id</name>
52 <type>int unsigned</type>
53 <title>Event ID</title>
54 <import>true</import>
55 <headerPattern>/event id$/i</headerPattern>
56 <required>true</required>
57 <comment>FK to Event ID</comment>
58 <html>
59 <label>Event</label>
60 </html>
61 <add>1.7</add>
62 </field>
63 <foreignKey>
64 <name>event_id</name>
65 <table>civicrm_event</table>
66 <key>id</key>
67 <onDelete>CASCADE</onDelete>
68 </foreignKey>
69 <field>
70 <name>status_id</name>
71 <uniqueName>participant_status_id</uniqueName>
72 <title>Status ID</title>
73 <headerPattern>/(participant.)?(status)$/i</headerPattern>
74 <import>true</import>
75 <type>int unsigned</type>
76 <export>true</export>
77 <required>true</required>
78 <default>1</default>
79 <comment>Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.</comment>
80 <add>1.7</add>
81 <pseudoconstant>
82 <table>civicrm_participant_status_type</table>
83 <keyColumn>id</keyColumn>
84 <labelColumn>label</labelColumn>
85 </pseudoconstant>
86 <html>
87 <type>Select</type>
88 <label>Status</label>
89 </html>
90 </field>
91 <foreignKey>
92 <name>status_id</name>
93 <table>civicrm_participant_status_type</table>
94 <key>id</key>
95 <add>3.0</add>
96 </foreignKey>
97 <index>
98 <name>index_status_id</name>
99 <fieldName>status_id</fieldName>
100 <add>1.8</add>
101 </index>
102 <field>
103 <name>role_id</name>
104 <uniqueName>participant_role_id</uniqueName>
105 <title>Participant Role</title>
106 <pseudoconstant>
107 <optionGroupName>participant_role</optionGroupName>
108 </pseudoconstant>
109 <html>
110 <type>Select</type>
111 <multiple>1</multiple>
112 </html>
113 <serialize>SEPARATOR_TRIMMED</serialize>
114 <headerPattern>/(participant.)?(role)$/i</headerPattern>
115 <import>true</import>
116 <type>varchar</type>
117 <length>128</length>
118 <export>true</export>
119 <default>NULL</default>
120 <comment>Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.</comment>
121 <add>1.7</add>
122 </field>
123 <index>
124 <name>index_role_id</name>
125 <fieldName>role_id</fieldName>
126 <add>1.8</add>
127 </index>
128 <field>
129 <name>register_date</name>
130 <uniqueName>participant_register_date</uniqueName>
131 <title>Register date</title>
132 <headerPattern>/^(r(egister\s)?date)$/i</headerPattern>
133 <import>true</import>
134 <type>datetime</type>
135 <comment>When did contact register for event?</comment>
136 <add>1.7</add>
137 <html>
138 <type>Select Date</type>
139 <formatType>activityDateTime</formatType>
140 </html>
141 </field>
142 <field>
143 <name>source</name>
144 <uniqueName>participant_source</uniqueName>
145 <title>Participant Source</title>
146 <headerPattern>/(participant.)?(source)$/i</headerPattern>
147 <import>true</import>
148 <type>varchar</type>
149 <length>128</length>
150 <comment>Source of this event registration.</comment>
151 <html>
152 <type>Text</type>
153 </html>
154 <add>1.7</add>
155 </field>
156 <field>
157 <name>fee_level</name>
158 <uniqueName>participant_fee_level</uniqueName>
159 <title>Fee level</title>
160 <headerPattern>/^(f(ee\s)?level)$/i</headerPattern>
161 <type>text</type>
162 <import>true</import>
163 <serialize>SEPARATOR_BOOKEND</serialize>
164 <comment>Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
165 we store the label value and not the key</comment>
166 <add>1.7</add>
167 </field>
168 <field>
169 <name>is_test</name>
170 <uniqueName>participant_is_test</uniqueName>
171 <title>Test</title>
172 <type>boolean</type>
173 <default>0</default>
174 <import>true</import>
175 <add>1.7</add>
176 </field>
177 <field>
178 <name>is_pay_later</name>
179 <uniqueName>participant_is_pay_later</uniqueName>
180 <title>Is Pay Later</title>
181 <type>boolean</type>
182 <default>0</default>
183 <import>true</import>
184 <headerPattern>/(is.)?(pay(.)?later)$/i</headerPattern>
185 <add>2.1</add>
186 </field>
187
188 <field>
189 <name>fee_amount</name>
190 <uniqueName>participant_fee_amount</uniqueName>
191 <title>Fee Amount</title>
192 <type>decimal</type>
193 <import>true</import>
194 <headerPattern>/fee(.?am(ou)?nt)?/i</headerPattern>
195 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
196 <comment>actual processor fee if known - may be 0.</comment>
197 <add>2.1</add>
198 </field>
199 <field>
200 <name>registered_by_id</name>
201 <uniqueName>participant_registered_by_id</uniqueName>
202 <type>int unsigned</type>
203 <title>Registered By Participant ID</title>
204 <import>true</import>
205 <default>NULL</default>
206 <comment>FK to Participant ID</comment>
207 <html>
208 <label>Registered By</label>
209 </html>
210 <add>2.1</add>
211 <export>true</export>
212 </field>
213 <foreignKey>
214 <name>registered_by_id</name>
215 <table>civicrm_participant</table>
216 <key>id</key>
217 <add>2.1</add>
218 <onDelete>SET NULL</onDelete>
219 </foreignKey>
220 <field>
221 <name>discount_id</name>
222 <uniqueName>participant_discount_id</uniqueName>
223 <type>int unsigned</type>
224 <title>Discount ID</title>
225 <default>NULL</default>
226 <comment>FK to Discount ID</comment>
227 <html>
228 <label>Discount</label>
229 </html>
230 <add>2.1</add>
231 </field>
232 <foreignKey>
233 <name>discount_id</name>
234 <table>civicrm_discount</table>
235 <key>id</key>
236 <add>2.1</add>
237 <onDelete>SET NULL</onDelete>
238 </foreignKey>
239 <field>
240 <name>fee_currency</name>
241 <uniqueName>participant_fee_currency</uniqueName>
242 <title>Fee Currency</title>
243 <type>varchar</type>
244 <length>3</length>
245 <default>NULL</default>
246 <import>true</import>
247 <headerPattern>/(fee)?.?cur(rency)?/i</headerPattern>
248 <dataPattern>/^[A-Z]{3}$/i</dataPattern>
249 <comment>3 character string, value derived from config setting.</comment>
250 <add>3.0</add>
251 <pseudoconstant>
252 <table>civicrm_currency</table>
253 <keyColumn>name</keyColumn>
254 <labelColumn>full_name</labelColumn>
255 <nameColumn>name</nameColumn>
256 <abbrColumn>symbol</abbrColumn>
257 </pseudoconstant>
258 <html>
259 <type>Select</type>
260 </html>
261 </field>
262 <field>
263 <name>campaign_id</name>
264 <component>CiviCampaign</component>
265 <uniqueName>participant_campaign_id</uniqueName>
266 <type>int unsigned</type>
267 <title>Campaign ID</title>
268 <import>true</import>
269 <comment>The campaign for which this participant has been registered.</comment>
270 <html>
271 <type>EntityRef</type>
272 <label>Campaign</label>
273 </html>
274 <add>3.4</add>
275 <pseudoconstant>
276 <table>civicrm_campaign</table>
277 <keyColumn>id</keyColumn>
278 <labelColumn>title</labelColumn>
279 <prefetch>FALSE</prefetch>
280 </pseudoconstant>
281 </field>
282 <foreignKey>
283 <name>campaign_id</name>
284 <table>civicrm_campaign</table>
285 <key>id</key>
286 <onDelete>SET NULL</onDelete>
287 </foreignKey>
288 <field>
289 <name>discount_amount</name>
290 <type>int unsigned</type>
291 <title>Discount Amount</title>
292 <comment>Discount Amount</comment>
293 <add>4.1</add>
294 </field>
295 <field>
296 <name>cart_id</name>
297 <type>int unsigned</type>
298 <title>Event Cart ID</title>
299 <comment>FK to civicrm_event_carts</comment>
300 <html>
301 <label>Event Cart</label>
302 </html>
303 <add>4.1</add>
304 </field>
305 <foreignKey>
306 <name>cart_id</name>
307 <table>civicrm_event_carts</table>
308 <key>id</key>
309 <onDelete>SET NULL</onDelete>
310 </foreignKey>
311 <field>
312 <name>must_wait</name>
313 <type>int</type>
314 <title>Must Wait on List</title>
315 <comment>On Waiting List</comment>
316 <add>4.1</add>
317 </field>
318 <field>
319 <name>transferred_to_contact_id</name>
320 <uniqueName>transferred_to_contact_id</uniqueName>
321 <type>int unsigned</type>
322 <default>NULL</default>
323 <title>Transferred to Contact ID</title>
324 <headerPattern>/transfer(.?id)?/i</headerPattern>
325 <import>true</import>
326 <comment>FK to Contact ID</comment>
327 <html>
328 <label>Transferred to</label>
329 </html>
330 <add>4.7</add>
331 </field>
332 <foreignKey>
333 <name>transferred_to_contact_id</name>
334 <table>civicrm_contact</table>
335 <key>id</key>
336 <onDelete>SET NULL</onDelete>
337 </foreignKey>
338 </table>