Merge pull request #13232 from JO0st/core-574
[civicrm-core.git] / xml / schema / Activity / Activity.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2<table>
3 <base>CRM/Activity</base>
4 <class>Activity</class>
5 <name>civicrm_activity</name>
165a7fc0 6 <comment>Other Activity details stored here include contact, location, details.</comment>
6a488035
TO
7 <add>1.1</add>
8 <log>true</log>
9 <field>
29e8791c
EM
10 <name>id</name>
11 <uniqueName>activity_id</uniqueName>
12 <title>Activity ID</title>
13 <import>true</import>
14 <type>int unsigned</type>
15 <required>true</required>
16 <comment>Unique Other Activity ID</comment>
17 <add>1.1</add>
6a488035
TO
18 </field>
19 <primaryKey>
29e8791c
EM
20 <name>id</name>
21 <autoincrement>true</autoincrement>
6a488035
TO
22 </primaryKey>
23 <field>
29e8791c
EM
24 <name>source_contact_id</name>
25 <type>int unsigned</type>
26 <title>Source Contact</title>
27 <import>true</import>
28 <headerPattern>/(activity.)?source(.contact(.id)?)?/i</headerPattern>
29 <comment>Contact ID of the person scheduling or logging this Activity. Usually the authenticated user.</comment>
30 <add>1.1</add>
31 <drop>4.4</drop>
6a488035
TO
32 </field>
33 <foreignKey>
29e8791c
EM
34 <name>source_contact_id</name>
35 <table>civicrm_contact</table>
36 <key>id</key>
37 <add>1.1</add>
38 <drop>4.4</drop>
39 <onDelete>SET NULL</onDelete>
3f3a3ba0 40 </foreignKey>
6a488035 41 <index>
29e8791c
EM
42 <name>UI_source_contact_id</name>
43 <fieldName>source_contact_id</fieldName>
44 <add>2.0</add>
45 <drop>3.2</drop>
6a488035 46 </index>
6a488035 47 <field>
29e8791c
EM
48 <name>source_record_id</name>
49 <type>int unsigned</type>
50 <title>Source Record</title>
51 <comment>Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.</comment>
52 <add>2.0</add>
6a488035
TO
53 </field>
54 <index>
29e8791c
EM
55 <name>UI_source_record_id</name>
56 <fieldName>source_record_id</fieldName>
57 <add>3.2</add>
6a488035
TO
58 </index>
59 <field>
29e8791c 60 <name>activity_type_id</name>
3542118f 61 <title>Activity Type</title>
29e8791c
EM
62 <import>true</import>
63 <type>int unsigned</type>
64 <required>true</required>
9ab34172 65 <export>true</export>
29e8791c
EM
66 <default>1</default>
67 <headerPattern>/(activity.)?type(.id$)/i</headerPattern>
68 <comment>FK to civicrm_option_value.id, that has to be valid, registered activity type.</comment>
69 <add>1.1</add>
70 <pseudoconstant>
71 <optionGroupName>activity_type</optionGroupName>
72 </pseudoconstant>
73 <html>
74 <type>Select</type>
75 </html>
6a488035
TO
76 </field>
77 <index>
29e8791c
EM
78 <name>UI_activity_type_id</name>
79 <fieldName>activity_type_id</fieldName>
80 <add>1.6</add>
6a488035 81 </index>
6a488035 82 <field>
29e8791c
EM
83 <name>target_entity_table</name>
84 <type>varchar</type>
85 <length>64</length>
86 <required>true</required>
87 <comment>Name of table where item being referenced is stored.</comment>
88 <add>1.1</add>
89 <drop>2.0</drop>
6a488035 90 </field>
6a488035 91 <field>
29e8791c
EM
92 <name>target_entity_id</name>
93 <type>int unsigned</type>
94 <required>true</required>
95 <comment>Foreign key to the referenced item.</comment>
96 <add>1.1</add>
97 <drop>2.0</drop>
6a488035 98 </field>
6a488035 99 <field>
29e8791c
EM
100 <name>subject</name>
101 <uniqueName>activity_subject</uniqueName>
102 <type>varchar</type>
103 <title>Subject</title>
104 <length>255</length>
105 <comment>The subject/purpose/short description of the activity.</comment>
106 <import>true</import>
107 <headerPattern>/(activity.)?subject/i</headerPattern>
108 <html>
109 <type>Text</type>
110 </html>
111 <add>1.1</add>
a8162657 112 <change>2.0</change>
6a488035 113 </field>
6a488035 114 <field>
29e8791c
EM
115 <name>scheduled_date</name>
116 <type>datetime</type>
117 <comment>Date and time meeting is scheduled to occur.</comment>
118 <add>1.1</add>
119 <drop>2.0</drop>
6a488035 120 </field>
6a488035 121 <field>
29e8791c
EM
122 <name>activity_date_time</name>
123 <import>true</import>
124 <title>Activity Date</title>
125 <type>datetime</type>
126 <headerPattern>/(activity.)?date(.time$)?/i</headerPattern>
127 <comment>Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.</comment>
128 <html>
129 <type>Select Date</type>
24317d89 130 <formatType>activityDateTime</formatType>
29e8791c
EM
131 </html>
132 <add>2.0</add>
3f3a3ba0 133 </field>
ab49600a
SL
134 <index>
135 <name>index_activity_date_time</name>
136 <fieldName>activity_date_time</fieldName>
137 <add>4.7</add>
138 </index>
6a488035 139 <field>
29e8791c
EM
140 <name>due_date_time</name>
141 <type>datetime</type>
142 <comment>Date and time this activity is due.</comment>
143 <add>2.0</add>
144 <drop>3.0</drop>
3f3a3ba0 145 </field>
6a488035 146 <field>
29e8791c
EM
147 <name>duration_hours</name>
148 <type>int unsigned</type>
149 <comment>Planned or actual duration of meeting - hours.</comment>
150 <add>1.1</add>
151 <drop>2.0</drop>
6a488035 152 </field>
6a488035 153 <field>
29e8791c
EM
154 <name>duration_minutes</name>
155 <type>int unsigned</type>
156 <comment>Planned or actual duration of meeting - minutes.</comment>
157 <add>1.1</add>
158 <drop>2.0</drop>
6a488035 159 </field>
6a488035 160 <field>
29e8791c
EM
161 <name>duration</name>
162 <uniqueName>activity_duration</uniqueName>
163 <title>Duration</title>
164 <import>true</import>
165 <type>int unsigned</type>
166 <headerPattern>/(activity.)?duration(s)?$/i</headerPattern>
167 <comment>Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.</comment>
168 <add>2.0</add>
169 <html>
3542118f 170 <type>Number</type>
29e8791c 171 </html>
6a488035 172 </field>
6a488035 173 <field>
29e8791c
EM
174 <name>location</name>
175 <uniqueName>activity_location</uniqueName>
176 <title>Location</title>
177 <import>true</import>
178 <type>varchar</type>
179 <length>255</length>
180 <headerPattern>/(activity.)?location$/i</headerPattern>
181 <comment>Location of the activity (optional, open text).</comment>
182 <html>
183 <type>Text</type>
184 </html>
185 <add>1.1</add>
6a488035 186 </field>
6a488035 187 <field>
29e8791c
EM
188 <name>phone_id</name>
189 <type>int unsigned</type>
3542118f 190 <title>Phone (called)</title>
29e8791c
EM
191 <comment>Phone ID of the number called (optional - used if an existing phone number is selected).</comment>
192 <add>2.0</add>
193 <html>
916b6181 194 <type>EntityRef</type>
29e8791c 195 </html>
6a488035
TO
196 </field>
197 <foreignKey>
29e8791c
EM
198 <name>phone_id</name>
199 <table>civicrm_phone</table>
200 <key>id</key>
201 <add>2.0</add>
202 <onDelete>SET NULL</onDelete>
6a488035 203 </foreignKey>
6a488035 204 <field>
29e8791c
EM
205 <name>phone_number</name>
206 <title>Phone (called) Number</title>
207 <type>varchar</type>
208 <length>64</length>
209 <comment>Phone number in case the number does not exist in the civicrm_phone table.</comment>
210 <html>
211 <type>Text</type>
212 </html>
213 <add>2.0</add>
6a488035 214 </field>
6a488035 215 <field>
29e8791c
EM
216 <name>details</name>
217 <uniqueName>activity_details</uniqueName>
218 <title>Details</title>
219 <import>true</import>
07f093c3 220 <type>longtext</type>
29e8791c
EM
221 <headerPattern>/(activity.)?detail(s)?$/i</headerPattern>
222 <comment>Details about the activity (agenda, notes, etc).</comment>
223 <html>
224 <type>RichTextEditor</type>
225 <rows>8</rows>
226 <cols>60</cols>
227 </html>
228 <add>1.1</add>
6a488035 229 </field>
6a488035 230 <field>
29e8791c
EM
231 <name>status</name>
232 <type>enum</type>
233 <title>Status</title>
234 <values>Scheduled, Completed</values>
235 <comment>What is the status of this meeting? Completed meeting status results in activity history entry.</comment>
236 <add>1.1</add>
237 <drop>2.0</drop>
6a488035 238 </field>
6a488035 239 <field>
29e8791c
EM
240 <name>status_id</name>
241 <uniqueName>activity_status_id</uniqueName>
242 <title>Activity Status</title>
243 <import>true</import>
a0655ae9 244 <export>true</export>
29e8791c
EM
245 <headerPattern>/(activity.)?status(.label$)?/i</headerPattern>
246 <type>int unsigned</type>
247 <comment>ID of the status this activity is currently in. Foreign key to civicrm_option_value.</comment>
248 <add>2.0</add>
249 <pseudoconstant>
250 <optionGroupName>activity_status</optionGroupName>
251 </pseudoconstant>
252 <html>
253 <type>Select</type>
254 </html>
255 </field>
5b3543ce
JM
256 <index>
257 <name>index_status_id</name>
258 <fieldName>status_id</fieldName>
259 <add>4.7</add>
260 </index>
29e8791c
EM
261 <field>
262 <name>priority_id</name>
263 <type>int unsigned</type>
264 <title>Priority</title>
265 <comment>ID of the priority given to this activity. Foreign key to civicrm_option_value.</comment>
266 <add>2.0</add>
267 <pseudoconstant>
268 <optionGroupName>priority</optionGroupName>
269 </pseudoconstant>
270 <html>
271 <type>Select</type>
272 </html>
273 </field>
274 <field>
275 <name>parent_id</name>
276 <title>Parent Activity Id</title>
277 <type>int unsigned</type>
278 <comment>Parent meeting ID (if this is a follow-up item). This is not currently implemented</comment>
279 <add>1.1</add>
6a488035
TO
280 </field>
281 <foreignKey>
29e8791c
EM
282 <name>parent_id</name>
283 <table>civicrm_activity</table>
284 <key>id</key>
285 <add>1.1</add>
286 <onDelete>CASCADE</onDelete>
6a488035 287 </foreignKey>
6a488035 288 <field>
29e8791c
EM
289 <name>is_test</name>
290 <title>Test</title>
291 <uniqueName>activity_is_test</uniqueName>
292 <type>boolean</type>
293 <default>0</default>
294 <import>true</import>
295 <headerPattern>/(is.)?test(.activity)?/i</headerPattern>
296 <add>2.0</add>
297 <html>
3542118f 298 <type>CheckBox</type>
29e8791c
EM
299 </html>
300 </field>
301 <field>
302 <name>medium_id</name>
303 <uniqueName>activity_medium_id</uniqueName>
304 <title>Activity Medium</title>
305 <type>int unsigned</type>
306 <default>NULL</default>
307 <comment>Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.</comment>
308 <pseudoconstant>
309 <optionGroupName>encounter_medium</optionGroupName>
310 </pseudoconstant>
311 <html>
312 <type>Select</type>
313 </html>
314 <add>2.2</add>
6a488035
TO
315 </field>
316 <index>
29e8791c
EM
317 <name>index_medium_id</name>
318 <fieldName>medium_id</fieldName>
319 <add>2.2</add>
6a488035
TO
320 </index>
321 <field>
29e8791c
EM
322 <name>is_auto</name>
323 <title>Auto</title>
324 <type>boolean</type>
325 <default>0</default>
326 <add>2.2</add>
3f3a3ba0
CW
327 </field>
328 <field>
29e8791c
EM
329 <name>relationship_id</name>
330 <title>Relationship Id</title>
331 <type>int unsigned</type>
332 <default>NULL</default>
333 <comment>FK to Relationship ID</comment>
334 <add>2.2</add>
6a488035 335 </field>
3f3a3ba0 336 <foreignKey>
29e8791c
EM
337 <name>relationship_id</name>
338 <table>civicrm_relationship</table>
339 <key>id</key>
340 <onDelete>SET NULL</onDelete>
3f3a3ba0 341 </foreignKey>
6a488035 342 <field>
29e8791c
EM
343 <name>is_current_revision</name>
344 <title>Is this activity a current revision in versioning chain?</title>
345 <type>boolean</type>
346 <default>1</default>
347 <import>true</import>
348 <headerPattern>/(is.)?(current.)?(revision|version(ing)?)/i</headerPattern>
349 <add>2.2</add>
6a488035
TO
350 </field>
351 <index>
29e8791c
EM
352 <name>index_is_current_revision</name>
353 <fieldName>is_current_revision</fieldName>
354 <add>2.2</add>
3f3a3ba0 355 </index>
6a488035 356 <field>
29e8791c
EM
357 <name>original_id</name>
358 <type>int unsigned</type>
359 <title>Original Activity ID </title>
360 <comment>Activity ID of the first activity record in versioning chain.</comment>
361 <add>2.2</add>
6a488035
TO
362 </field>
363 <foreignKey>
29e8791c
EM
364 <name>original_id</name>
365 <table>civicrm_activity</table>
366 <key>id</key>
367 <add>2.2</add>
368 <onDelete>CASCADE</onDelete>
6a488035
TO
369 </foreignKey>
370 <index>
29e8791c
EM
371 <name>UI_original_id</name>
372 <fieldName>original_id</fieldName>
373 <add>2.2</add>
374 <drop>3.2</drop>
3f3a3ba0 375 </index>
6a488035 376 <field>
29e8791c
EM
377 <name>result</name>
378 <uniqueName>activity_result</uniqueName>
379 <type>varchar</type>
380 <title>Result</title>
381 <length>255</length>
382 <comment>Currently being used to store result id for survey activity, FK to option value.</comment>
29e8791c
EM
383 <add>3.3</add>
384 </field>
385 <field>
386 <name>is_deleted</name>
387 <uniqueName>activity_is_deleted</uniqueName>
388 <title>Activity is in the Trash</title>
389 <type>boolean</type>
390 <default>0</default>
391 <import>true</import>
392 <headerPattern>/(activity.)?(trash|deleted)/i</headerPattern>
393 <add>2.2</add>
394 <html>
3542118f 395 <type>CheckBox</type>
29e8791c 396 </html>
6a488035
TO
397 </field>
398 <index>
29e8791c
EM
399 <name>index_is_deleted</name>
400 <fieldName>is_deleted</fieldName>
401 <add>2.2</add>
6a488035 402 </index>
3f3a3ba0 403 <field>
29e8791c
EM
404 <name>campaign_id</name>
405 <uniqueName>activity_campaign_id</uniqueName>
406 <type>int unsigned</type>
407 <title>Campaign</title>
408 <import>true</import>
409 <comment>The campaign for which this activity has been triggered.</comment>
410 <pseudoconstant>
411 <table>civicrm_campaign</table>
412 <keyColumn>id</keyColumn>
413 <labelColumn>title</labelColumn>
414 </pseudoconstant>
415 <add>3.4</add>
416 <html>
3542118f 417 <type>Select</type>
29e8791c 418 </html>
6a488035 419 </field>
3f3a3ba0 420 <foreignKey>
29e8791c
EM
421 <name>campaign_id</name>
422 <table>civicrm_campaign</table>
423 <key>id</key>
424 <onDelete>SET NULL</onDelete>
6a488035 425 </foreignKey>
3f3a3ba0 426 <field>
29e8791c
EM
427 <name>engagement_level</name>
428 <uniqueName>activity_engagement_level</uniqueName>
429 <type>int unsigned</type>
430 <title>Engagement Index</title>
431 <import>true</import>
432 <comment>Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.</comment>
433 <pseudoconstant>
434 <optionGroupName>engagement_index</optionGroupName>
435 </pseudoconstant>
436 <html>
437 <type>Select</type>
438 </html>
439 <add>3.4</add>
440 </field>
441 <field>
442 <name>weight</name>
7ecddde4 443 <title>Order</title>
29e8791c
EM
444 <type>int</type>
445 <add>4.1</add>
6a488035 446 </field>
cd063b10
CW
447 <field>
448 <name>is_star</name>
449 <title>Is Starred</title>
450 <type>boolean</type>
451 <default>0</default>
452 <import>true</import>
453 <comment>Activity marked as favorite.</comment>
454 <headerPattern>/(activity.)?(star|favorite)/i</headerPattern>
455 <add>4.7</add>
3542118f
CW
456 <html>
457 <type>Checkbox</type>
458 </html>
cd063b10 459 </field>
3ed77291
TO
460 <field>
461 <name>created_date</name>
462 <uniqueName>activity_created_date</uniqueName>
463 <type>timestamp</type>
464 <comment>When was the activity was created.</comment>
465 <required>false</required>
466 <export>true</export>
467 <default>NULL</default>
468 <add>4.7</add>
469 </field>
470 <field>
471 <name>modified_date</name>
472 <uniqueName>activity_modified_date</uniqueName>
473 <type>timestamp</type>
474 <comment>When was the activity (or closely related entity) was created or modified or deleted.</comment>
475 <required>false</required>
476 <export>true</export>
477 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
478 <add>4.7</add>
479 </field>
6a488035 480</table>