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