c49d796b8335dc50d233810593144c04907c28ff
[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 Id</title>
61 <headerPattern>/(participant.)?(status)$/i</headerPattern>
62 <import>true</import>
63 <type>int unsigned</type>
64 <export>false</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 </field>
75 <foreignKey>
76 <name>status_id</name>
77 <table>civicrm_participant_status_type</table>
78 <key>id</key>
79 <add>3.0</add>
80 </foreignKey>
81 <index>
82 <name>index_status_id</name>
83 <fieldName>status_id</fieldName>
84 <add>1.8</add>
85 </index>
86 <field>
87 <name>role_id</name>
88 <uniqueName>participant_role_id</uniqueName>
89 <title>Participant Role Id</title>
90 <pseudoconstant>
91 <optionGroupName>participant_role</optionGroupName>
92 </pseudoconstant>
93 <headerPattern>/(participant.)?(role)$/i</headerPattern>
94 <import>true</import>
95 <type>varchar</type>
96 <length>128</length>
97 <export>false</export>
98 <default>NULL</default>
99 <comment>Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.</comment>
100 <add>1.7</add>
101 </field>
102 <index>
103 <name>index_role_id</name>
104 <fieldName>role_id</fieldName>
105 <add>1.8</add>
106 </index>
107 <field>
108 <name>register_date</name>
109 <uniqueName>participant_register_date</uniqueName>
110 <title>Register date</title>
111 <headerPattern>/^(r(egister\s)?date)$/i</headerPattern>
112 <import>true</import>
113 <type>datetime</type>
114 <comment>When did contact register for event?</comment>
115 <add>1.7</add>
116 </field>
117 <field>
118 <name>source</name>
119 <uniqueName>participant_source</uniqueName>
120 <title>Participant Source</title>
121 <headerPattern>/(participant.)?(source)$/i</headerPattern>
122 <import>true</import>
123 <type>varchar</type>
124 <length>128</length>
125 <comment>Source of this event registration.</comment>
126 <add>1.7</add>
127 </field>
128 <field>
129 <name>fee_level</name>
130 <uniqueName>participant_fee_level</uniqueName>
131 <title>Fee level</title>
132 <headerPattern>/^(f(ee\s)?level)$/i</headerPattern>
133 <type>text</type>
134 <import>true</import>
135 <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>
136 <add>1.7</add>
137 </field>
138 <field>
139 <name>is_test</name>
140 <uniqueName>participant_is_test</uniqueName>
141 <title>Test</title>
142 <type>boolean</type>
143 <default>0</default>
144 <import>true</import>
145 <add>1.7</add>
146 </field>
147 <field>
148 <name>is_pay_later</name>
149 <uniqueName>participant_is_pay_later</uniqueName>
150 <title>Is Pay Later</title>
151 <type>boolean</type>
152 <default>0</default>
153 <import>true</import>
154 <headerPattern>/(is.)?(pay(.)?later)$/i</headerPattern>
155 <add>2.1</add>
156 </field>
157
158 <field>
159 <name>fee_amount</name>
160 <uniqueName>participant_fee_amount</uniqueName>
161 <title>Fee Amount</title>
162 <type>decimal</type>
163 <import>true</import>
164 <headerPattern>/fee(.?am(ou)?nt)?/i</headerPattern>
165 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
166 <comment>actual processor fee if known - may be 0.</comment>
167 <add>2.1</add>
168 </field>
169 <field>
170 <name>registered_by_id</name>
171 <uniqueName>participant_registered_by_id</uniqueName>
172 <type>int unsigned</type>
173 <title>Registered By ID</title>
174 <import>true</import>
175 <default>NULL</default>
176 <comment>FK to Participant ID</comment>
177 <add>2.1</add>
178 <export>true</export>
179 </field>
180 <foreignKey>
181 <name>registered_by_id</name>
182 <table>civicrm_participant</table>
183 <key>id</key>
184 <add>2.1</add>
185 <onDelete>SET NULL</onDelete>
186 </foreignKey>
187 <field>
188 <name>discount_id</name>
189 <uniqueName>participant_discount_id</uniqueName>
190 <type>int unsigned</type>
191 <title>Discount ID</title>
192 <default>NULL</default>
193 <comment>FK to Discount ID</comment>
194 <add>2.1</add>
195 </field>
196 <foreignKey>
197 <name>discount_id</name>
198 <table>civicrm_discount</table>
199 <key>id</key>
200 <add>2.1</add>
201 <onDelete>SET NULL</onDelete>
202 </foreignKey>
203 <field>
204 <name>fee_currency</name>
205 <uniqueName>participant_fee_currency</uniqueName>
206 <title>Fee Currency</title>
207 <type>varchar</type>
208 <length>3</length>
209 <default>NULL</default>
210 <import>true</import>
211 <headerPattern>/(fee)?.?cur(rency)?/i</headerPattern>
212 <dataPattern>/^[A-Z]{3}$/i</dataPattern>
213 <comment>3 character string, value derived from config setting.</comment>
214 <add>3.0</add>
215 <pseudoconstant>
216 <table>civicrm_currency</table>
217 <keyColumn>name</keyColumn>
218 <labelColumn>full_name</labelColumn>
219 <nameColumn>numeric_code</nameColumn>
220 </pseudoconstant>
221 </field>
222 <field>
223 <name>campaign_id</name>
224 <uniqueName>participant_campaign_id</uniqueName>
225 <type>int unsigned</type>
226 <title>Campaign ID</title>
227 <import>true</import>
228 <comment>The campaign for which this participant has been registered.</comment>
229 <pseudoconstant>
230 <table>civicrm_campaign</table>
231 <keyColumn>id</keyColumn>
232 <labelColumn>title</labelColumn>
233 <condition>(end_date IS NULL OR end_date > NOW())</condition>
234 </pseudoconstant>
235 <add>3.4</add>
236 </field>
237 <foreignKey>
238 <name>campaign_id</name>
239 <table>civicrm_campaign</table>
240 <key>id</key>
241 <onDelete>SET NULL</onDelete>
242 </foreignKey>
243 <field>
244 <name>discount_amount</name>
245 <type>int unsigned</type>
246 <title>Discount Amount</title>
247 <comment>Discount Amount</comment>
248 <add>4.1</add>
249 </field>
250 <field>
251 <name>cart_id</name>
252 <type>int unsigned</type>
253 <title>Event Cart ID</title>
254 <comment>FK to civicrm_event_carts</comment>
255 <add>4.1</add>
256 </field>
257 <foreignKey>
258 <name>cart_id</name>
259 <table>civicrm_event_carts</table>
260 <key>id</key>
261 <onDelete>SET NULL</onDelete>
262 </foreignKey>
263 <field>
264 <name>must_wait</name>
265 <type>int</type>
266 <title>Must Wait on List</title>
267 <comment>On Waiting List</comment>
268 <add>4.1</add>
269 </field>
270 </table>