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