Add index to civicrm_contact.created_date & modified_date
[civicrm-core.git] / xml / schema / Contact / Contact.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contact</base>
5 <class>Contact</class>
6 <name>civicrm_contact</name>
7 <comment>Contact objects are defined by a civicrm_contact record plus a related civicrm_contact_type record.</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>Contact ID</title>
14 <import>true</import>
15 <headerPattern>/internal|contact?|id$/i</headerPattern>
16 <required>true</required>
17 <comment>Unique Contact 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>contact_type</name>
26 <title>Contact Type</title>
27 <type>varchar</type>
28 <length>64</length>
29 <comment>Type of Contact.</comment>
30 <export>true</export>
31 <pseudoconstant>
32 <table>civicrm_contact_type</table>
33 <keyColumn>name</keyColumn>
34 <labelColumn>label</labelColumn>
35 <condition>parent_id IS NULL</condition>
36 </pseudoconstant>
37 <html>
38 <type>Select</type>
39 </html>
40 <add>1.1</add>
41 <change>3.1</change>
42 </field>
43 <index>
44 <name>index_contact_type</name>
45 <fieldName>contact_type</fieldName>
46 <add>2.1</add>
47 </index>
48 <field>
49 <name>contact_sub_type</name>
50 <title>Contact Subtype</title>
51 <type>varchar</type>
52 <length>255</length>
53 <export>true</export>
54 <import>true</import>
55 <headerPattern>/C(ontact )?(subtype|sub-type|sub type)/i</headerPattern>
56 <comment>May be used to over-ride contact view and edit templates.</comment>
57 <pseudoconstant>
58 <table>civicrm_contact_type</table>
59 <keyColumn>name</keyColumn>
60 <labelColumn>label</labelColumn>
61 <condition>parent_id IS NOT NULL</condition>
62 </pseudoconstant>
63 <html>
64 <type>Select</type>
65 <multiple>1</multiple>
66 </html>
67 <serialize>SEPARATOR_BOOKEND</serialize>
68 <add>1.5</add>
69 </field>
70 <index>
71 <name>index_contact_sub_type</name>
72 <fieldName>contact_sub_type</fieldName>
73 <add>2.1</add>
74 </index>
75 <field>
76 <name>do_not_email</name>
77 <type>boolean</type>
78 <import>true</import>
79 <headerPattern>/d(o )?(not )?(email)/i</headerPattern>
80 <dataPattern>/^\d{1,}$/</dataPattern>
81 <default>0</default>
82 <html>
83 <type>CheckBox</type>
84 </html>
85 <add>1.1</add>
86 </field>
87 <field>
88 <name>do_not_phone</name>
89 <type>boolean</type>
90 <default>0</default>
91 <import>true</import>
92 <headerPattern>/d(o )?(not )?(call|phone)/i</headerPattern>
93 <dataPattern>/^\d{1,}$/</dataPattern>
94 <add>1.1</add>
95 <html>
96 <type>CheckBox</type>
97 </html>
98 </field>
99 <field>
100 <name>do_not_mail</name>
101 <type>boolean</type>
102 <import>true</import>
103 <headerPattern>/^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i</headerPattern>
104 <dataPattern>/^\d{1,}$/</dataPattern>
105 <default>0</default>
106 <add>1.1</add>
107 <html>
108 <type>CheckBox</type>
109 </html>
110 </field>
111 <field>
112 <name>do_not_sms</name>
113 <type>boolean</type>
114 <import>true</import>
115 <headerPattern>/d(o )?(not )?(sms)/i</headerPattern>
116 <dataPattern>/^\d{1,}$/</dataPattern>
117 <default>0</default>
118 <add>3.0</add>
119 <html>
120 <type>CheckBox</type>
121 </html>
122 </field>
123 <field>
124 <name>do_not_trade</name>
125 <type>boolean</type>
126 <import>true</import>
127 <headerPattern>/d(o )?(not )?(trade)/i</headerPattern>
128 <dataPattern>/^\d{1,}$/</dataPattern>
129 <default>0</default>
130 <add>1.1</add>
131 <html>
132 <type>CheckBox</type>
133 </html>
134 </field>
135 <field>
136 <name>is_opt_out</name>
137 <type>boolean</type>
138 <title>No Bulk Emails (User Opt Out)</title>
139 <default>0</default>
140 <import>true</import>
141 <required>true</required>
142 <comment>Has the contact opted out from receiving all bulk email from the organization or site domain?</comment>
143 <add>1.1</add>
144 <html>
145 <type>CheckBox</type>
146 </html>
147 </field>
148 <field>
149 <name>legal_identifier</name>
150 <type>varchar</type>
151 <length>32</length>
152 <import>true</import>
153 <headerPattern>/legal\s?id/i</headerPattern>
154 <dataPattern>/\w+?\d{5,}/</dataPattern>
155 <comment>May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.</comment>
156 <add>1.1</add>
157 <html>
158 <type>Text</type>
159 </html>
160 </field>
161 <field>
162 <name>external_identifier</name>
163 <type>varchar</type>
164 <length>64</length>
165 <html>
166 <type>Text</type>
167 <size>8</size>
168 </html>
169
170 <import>true</import>
171 <headerPattern>/external\s?id/i</headerPattern>
172 <dataPattern>/^\d{11,}$/</dataPattern>
173 <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.</comment>
174 <add>1.1</add>
175 </field>
176 <index>
177 <name>UI_external_identifier</name>
178 <unique>true</unique>
179 <fieldName>external_identifier</fieldName>
180 <add>1.7</add>
181 </index>
182 <field>
183 <name>sort_name</name>
184 <title>Sort Name</title>
185 <type>varchar</type>
186 <length>128</length>
187 <html>
188 <type>Text</type>
189 <size>30</size>
190 </html>
191
192 <export>true</export>
193 <comment>Name used for sorting different contact types</comment>
194 <add>1.1</add>
195 </field>
196 <index>
197 <name>index_sort_name</name>
198 <fieldName>sort_name</fieldName>
199 <add>2.1</add>
200 </index>
201 <field>
202 <name>display_name</name>
203 <title>Display Name</title>
204 <type>varchar</type>
205 <length>128</length>
206 <html>
207 <type>Text</type>
208 <size>30</size>
209 </html>
210
211 <export>true</export>
212 <comment>Formatted name representing preferred format for display/print/other output.</comment>
213 <add>1.1</add>
214 </field>
215 <field>
216 <name>nick_name</name>
217 <title>Nickname</title>
218 <type>varchar</type>
219 <length>128</length>
220 <html>
221 <type>Text</type>
222 <size>30</size>
223 </html>
224
225 <import>true</import>
226 <headerPattern>/n(ick\s)name|nick$/i</headerPattern>
227 <dataPattern>/^\w+$/</dataPattern>
228 <comment>Nickname.</comment>
229 <fulltext/>
230 <add>1.1</add>
231 </field>
232 <field>
233 <name>legal_name</name>
234 <type>varchar</type>
235 <length>128</length>
236 <html>
237 <type>Text</type>
238 <size>30</size>
239 </html>
240
241 <import>true</import>
242 <headerPattern>/^legal|(l(egal\s)?name)$/i</headerPattern>
243 <comment>Legal Name.</comment>
244 <fulltext/>
245 <add>1.1</add>
246 </field>
247 <field>
248 <name>home_URL</name>
249 <rule>url</rule>
250 <title>Website</title>
251 <type>varchar</type>
252 <length>128</length>
253 <html>
254 <type>Text</type>
255 <size>30</size>
256 </html>
257
258 <import>true</import>
259 <headerPattern>/^(home\sURL)|URL|web|site/i</headerPattern>
260 <dataPattern>/^[\w\/\:\.]+$/</dataPattern>
261 <comment>optional "home page" URL for this contact.</comment>
262 <add>1.1</add>
263 <drop>3.2</drop>
264 </field>
265 <field>
266 <name>image_URL</name>
267 <type>text</type>
268 <import>true</import>
269 <comment>optional URL for preferred image (photo, logo, etc.) to display for this contact.</comment>
270 <add>1.1</add>
271 <html>
272 <type>File</type>
273 <size>30</size>
274 </html>
275 </field>
276 <field>
277 <name>preferred_communication_method</name>
278 <title>Preferred Communication Method</title>
279 <type>varchar</type>
280 <length>255</length>
281 <import>true</import>
282 <headerPattern>/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i</headerPattern>
283 <dataPattern>/^\w+$/</dataPattern>
284 <comment>What is the preferred mode of communication.</comment>
285 <add>1.1</add>
286 <pseudoconstant>
287 <optionGroupName>preferred_communication_method</optionGroupName>
288 </pseudoconstant>
289 <html>
290 <type>Select</type>
291 <multiple>1</multiple>
292 </html>
293 <serialize>SEPARATOR_BOOKEND</serialize>
294 </field>
295 <index>
296 <name>index_preferred_communication_method</name>
297 <fieldName>preferred_communication_method</fieldName>
298 <add>1.6</add>
299 </index>
300 <field>
301 <name>preferred_language</name>
302 <title>Preferred Language</title>
303 <type>varchar</type>
304 <length>5</length>
305 <comment>Which language is preferred for communication. FK to languages in civicrm_option_value.</comment>
306 <headerPattern>/^lang/i</headerPattern>
307 <import>true</import>
308 <pseudoconstant>
309 <optionGroupName>languages</optionGroupName>
310 <keyColumn>name</keyColumn>
311 </pseudoconstant>
312 <html>
313 <type>Select</type>
314 </html>
315 <add>3.2</add>
316 </field>
317 <field>
318 <name>preferred_mail_format</name>
319 <type>varchar</type>
320 <length>8</length>
321 <default>"Both"</default>
322 <import>true</import>
323 <headerPattern>/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i</headerPattern>
324 <comment>What is the preferred mode of sending an email.</comment>
325 <add>1.1</add>
326 <pseudoconstant>
327 <callback>CRM_Core_SelectValues::pmf</callback>
328 </pseudoconstant>
329 <html>
330 <type>Select</type>
331 </html>
332 </field>
333 <field>
334 <name>hash</name>
335 <title>Contact Hash</title>
336 <type>varchar</type>
337 <length>32</length>
338 <comment>Key for validating requests related to this contact.</comment>
339 <add>1.1</add>
340 <change>1.5</change>
341 <export>true</export>
342 </field>
343 <index>
344 <name>index_hash</name>
345 <fieldName>hash</fieldName>
346 <add>2.1</add>
347 </index>
348 <field>
349 <name>api_key</name>
350 <type>varchar</type>
351 <length>32</length>
352 <comment>API Key for validating requests related to this contact.</comment>
353 <add>2.2</add>
354 <permission>
355 <or>administer CiviCRM, edit api keys</or>
356 </permission>
357 </field>
358 <index>
359 <name>index_api_key</name>
360 <fieldName>api_key</fieldName>
361 <add>2.1</add>
362 </index>
363 <field>
364 <name>source</name>
365 <title>Contact Source</title>
366 <uniqueName>contact_source</uniqueName>
367 <type>varchar</type>
368 <length>255</length>
369 <html>
370 <type>Text</type>
371 <size>30</size>
372 </html>
373
374 <import>true</import>
375 <headerPattern>/(C(ontact\s)?Source)$/i</headerPattern>
376 <comment>where contact come from, e.g. import, donate module insert...</comment>
377 <add>1.1</add>
378 </field>
379 <field>
380 <name>first_name</name>
381 <type>varchar</type>
382 <length>64</length>
383 <html>
384 <type>Text</type>
385 <size>30</size>
386 </html>
387 <import>true</import>
388 <headerPattern>/^first|(f(irst\s)?name)$/i</headerPattern>
389 <dataPattern>/^\w+$/</dataPattern>
390 <fulltext/>
391 <comment>First Name.</comment>
392 <add>1.1</add>
393 </field>
394 <index>
395 <name>index_first_name</name>
396 <fieldName>first_name</fieldName>
397 <add>1.8</add>
398 </index>
399 <field>
400 <name>middle_name</name>
401 <type>varchar</type>
402 <length>64</length>
403 <html>
404 <type>Text</type>
405 <size>30</size>
406 </html>
407 <import>true</import>
408 <headerPattern>/^middle|(m(iddle\s)?name)$/i</headerPattern>
409 <dataPattern>/^\w+$/</dataPattern>
410 <fulltext/>
411 <comment>Middle Name.</comment>
412 <add>1.1</add>
413 </field>
414 <field>
415 <name>last_name</name>
416 <type>varchar</type>
417 <length>64</length>
418 <html>
419 <type>Text</type>
420 <size>30</size>
421 </html>
422 <import>true</import>
423 <headerPattern>/^last|(l(ast\s)?name)$/i</headerPattern>
424 <dataPattern>/^\w+(\s\w+)?+$/</dataPattern>
425 <comment>Last Name.</comment>
426 <fulltext/>
427 <add>1.1</add>
428 </field>
429 <index>
430 <name>index_last_name</name>
431 <fieldName>last_name</fieldName>
432 <add>1.8</add>
433 <html>
434 <type>Text</type>
435 </html>
436 </index>
437 <field>
438 <name>prefix_id</name>
439 <title>Individual Prefix</title>
440 <type>int unsigned</type>
441 <comment>Prefix or Title for name (Ms, Mr...). FK to prefix ID</comment>
442 <pseudoconstant>
443 <optionGroupName>individual_prefix</optionGroupName>
444 </pseudoconstant>
445 <html>
446 <type>Select</type>
447 </html>
448 <headerPattern>/^(prefix|title)/i</headerPattern>
449 <dataPattern>/^(mr|ms|mrs|sir|dr)\.?$/i</dataPattern>
450 <import>true</import>
451 <add>1.2</add>
452 </field>
453 <index>
454 <name>UI_prefix</name>
455 <fieldName>prefix_id</fieldName>
456 <add>1.6</add>
457 </index>
458 <field>
459 <name>suffix_id</name>
460 <title>Individual Suffix</title>
461 <type>int unsigned</type>
462 <pseudoconstant>
463 <optionGroupName>individual_suffix</optionGroupName>
464 </pseudoconstant>
465 <html>
466 <type>Select</type>
467 </html>
468 <import>true</import>
469 <comment>Suffix for name (Jr, Sr...). FK to suffix ID</comment>
470 <headerPattern>/^suffix$/i</headerPattern>
471 <dataPattern>/^(sr|jr)\.?|i{2,}$/</dataPattern>
472 <add>1.2</add>
473 </field>
474 <index>
475 <name>UI_suffix</name>
476 <fieldName>suffix_id</fieldName>
477 <add>1.6</add>
478 </index>
479 <field>
480 <name>formal_title</name>
481 <type>varchar</type>
482 <length>64</length>
483 <import>true</import>
484 <html>
485 <type>Text</type>
486 </html>
487 <headerPattern>/^title/i</headerPattern>
488 <comment>Formal (academic or similar) title in front of name. (Prof., Dr. etc.)</comment>
489 <add>4.5</add>
490 </field>
491 <field>
492 <name>communication_style_id</name>
493 <title>Communication Style</title>
494 <type>int unsigned</type>
495 <pseudoconstant>
496 <optionGroupName>communication_style</optionGroupName>
497 </pseudoconstant>
498 <export>true</export>
499 <import>true</import>
500 <headerPattern>/style/i</headerPattern>
501 <comment>Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.</comment>
502 <add>4.4</add>
503 <html>
504 <type>Select</type>
505 </html>
506 </field>
507 <index>
508 <name>index_communication_style_id</name>
509 <fieldName>communication_style_id</fieldName>
510 <add>4.4</add>
511 </index>
512 <field>
513 <name>greeting_type</name>
514 <type>varchar</type>
515 <length>128</length>
516 <import>true</import>
517 <comment>Preferred greeting format.</comment>
518 <add>1.1</add>
519 <drop>2.2</drop>
520 </field>
521 <field>
522 <name>greeting_type_id</name>
523 <title>Greeting Type</title>
524 <type>int unsigned</type>
525 <comment>FK to civicrm_option_value.id, that has to be valid, registered Greeting type.</comment>
526 <add>2.2</add>
527 <drop>3.0</drop>
528 </field>
529 <field>
530 <name>custom_greeting</name>
531 <type>varchar</type>
532 <length>128</length>
533 <import>true</import>
534 <comment>Custom greeting message.</comment>
535 <add>1.1</add>
536 <drop>3.0</drop>
537 </field>
538 <field>
539 <name>email_greeting_id</name>
540 <type>int unsigned</type>
541 <title>Email Greeting ID</title>
542 <export>true</export>
543 <comment>FK to civicrm_option_value.id, that has to be valid registered Email Greeting.</comment>
544 <add>3.0</add>
545 <pseudoconstant>
546 <optionGroupName>email_greeting</optionGroupName>
547 </pseudoconstant>
548 </field>
549 <field>
550 <name>email_greeting_custom</name>
551 <type>varchar</type>
552 <length>128</length>
553 <import>true</import>
554 <export>false</export>
555 <comment>Custom Email Greeting.</comment>
556 <add>3.0</add>
557 <html>
558 <type>Text</type>
559 </html>
560 </field>
561 <field>
562 <name>email_greeting_display</name>
563 <title>Email Greeting</title>
564 <type>varchar</type>
565 <length>255</length>
566 <comment>Cache Email Greeting.</comment>
567 <add>3.0</add>
568 <html>
569 <type>Text</type>
570 </html>
571 </field>
572 <field>
573 <name>postal_greeting_id</name>
574 <type>int unsigned</type>
575 <title>Postal Greeting ID</title>
576 <export>true</export>
577 <comment>FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.</comment>
578 <add>3.0</add>
579 <html>
580 <type>Text</type>
581 </html>
582 <pseudoconstant>
583 <optionGroupName>postal_greeting</optionGroupName>
584 </pseudoconstant>
585 </field>
586 <field>
587 <name>postal_greeting_custom</name>
588 <type>varchar</type>
589 <length>128</length>
590 <import>true</import>
591 <export>false</export>
592 <comment>Custom Postal greeting.</comment>
593 <add>3.0</add>
594 <html>
595 <type>Text</type>
596 </html>
597 </field>
598 <field>
599 <name>postal_greeting_display</name>
600 <title>Postal Greeting</title>
601 <type>varchar</type>
602 <length>255</length>
603 <comment>Cache Postal greeting.</comment>
604 <add>3.0</add>
605 <html>
606 <type>Text</type>
607 </html>
608 </field>
609 <field>
610 <name>addressee_id</name>
611 <type>int unsigned</type>
612 <title>Addressee ID</title>
613 <comment>FK to civicrm_option_value.id, that has to be valid registered Addressee.</comment>
614 <add>3.0</add>
615 <export>true</export>
616 <pseudoconstant>
617 <optionGroupName>addressee</optionGroupName>
618 </pseudoconstant>
619 </field>
620 <field>
621 <name>addressee_custom</name>
622 <type>varchar</type>
623 <length>128</length>
624 <import>true</import>
625 <export>false</export>
626 <comment>Custom Addressee.</comment>
627 <add>3.0</add>
628 <html>
629 <type>Text</type>
630 </html>
631 </field>
632 <field>
633 <name>addressee_display</name>
634 <title>Addressee</title>
635 <type>varchar</type>
636 <length>255</length>
637 <comment>Cache Addressee.</comment>
638 <add>3.0</add>
639 <html>
640 <type>Text</type>
641 </html>
642 </field>
643 <field>
644 <name>job_title</name>
645 <type>varchar</type>
646 <length>255</length>
647 <html>
648 <type>Text</type>
649 <size>30</size>
650 </html>
651 <import>true</import>
652 <headerPattern>/^job|(j(ob\s)?title)$/i</headerPattern>
653 <dataPattern>//</dataPattern>
654 <comment>Job Title</comment>
655 <add>1.1</add>
656 </field>
657 <field>
658 <name>gender_id</name>
659 <title>Gender</title>
660 <type>int unsigned</type>
661 <pseudoconstant>
662 <optionGroupName>gender</optionGroupName>
663 </pseudoconstant>
664 <html>
665 <type>Select</type>
666 </html>
667 <headerPattern>/^gender$/i</headerPattern>
668 <comment>FK to gender ID</comment>
669 <import>true</import>
670 <add>1.2</add>
671 </field>
672 <index>
673 <name>UI_gender</name>
674 <fieldName>gender_id</fieldName>
675 <add>1.6</add>
676 <html>
677 <type>Select</type>
678 </html>
679 </index>
680 <field>
681 <name>birth_date</name>
682 <type>date</type>
683 <import>true</import>
684 <headerPattern>/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i</headerPattern>
685 <dataPattern>/\d{4}-?\d{2}-?\d{2}/</dataPattern>
686 <comment>Date of birth</comment>
687 <add>1.1</add>
688 <html>
689 <type>Select Date</type>
690 <formatType>birth</formatType>
691 </html>
692 </field>
693 <field>
694 <name>is_deceased</name>
695 <title>Deceased</title>
696 <import>true</import>
697 <export>true</export>
698 <headerPattern>/i(s\s)?d(eceased)$/i</headerPattern>
699 <type>boolean</type>
700 <default>0</default>
701 <add>1.1</add>
702 <html>
703 <type>CheckBox</type>
704 </html>
705 </field>
706 <index>
707 <name>index_is_deceased</name>
708 <fieldName>is_deceased</fieldName>
709 <add>4.7</add>
710 </index>
711 <field>
712 <name>deceased_date</name>
713 <type>date</type>
714 <import>true</import>
715 <export>true</export>
716 <headerPattern>/^deceased|(d(eceased\s)?date)$/i</headerPattern>
717 <comment>Date of deceased</comment>
718 <add>1.5</add>
719 <html>
720 <type>Select Date</type>
721 <formatType>birth</formatType>
722 </html>
723 </field>
724 <field>
725 <name>mail_to_household_id</name>
726 <title>Mail to Household ID</title>
727 <type>int unsigned</type>
728 <comment>OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location. </comment>
729 <export>true</export>
730 <add>1.1</add>
731 <drop>3.3</drop>
732 </field>
733 <foreignKey>
734 <name>mail_to_household_id</name>
735 <table>civicrm_contact</table>
736 <key>id</key>
737 <add>2.1</add>
738 <onDelete>SET NULL</onDelete>
739 <drop>3.3</drop>
740 </foreignKey>
741 <field>
742 <name>household_name</name>
743 <type>varchar</type>
744 <length>128</length>
745 <html>
746 <type>Text</type>
747 <size>30</size>
748 </html>
749 <import>true</import>
750 <headerPattern>/^household|(h(ousehold\s)?name)$/i</headerPattern>
751 <dataPattern>/^\w+$/</dataPattern>
752 <comment>Household Name.</comment>
753 <fulltext/>
754 <add>1.1</add>
755 </field>
756 <index>
757 <name>index_household_name</name>
758 <fieldName>household_name</fieldName>
759 <add>1.8</add>
760 </index>
761 <field>
762 <name>primary_contact_id</name>
763 <type>int unsigned</type>
764 <title>Household Primary Contact ID</title>
765 <comment>Optional FK to Primary Contact for this household.</comment>
766 <add>1.1</add>
767 <html>
768 <type>Select</type>
769 </html>
770 </field>
771 <foreignKey>
772 <name>primary_contact_id</name>
773 <table>civicrm_contact</table>
774 <key>id</key>
775 <add>1.1</add>
776 <onDelete>SET NULL</onDelete>
777 </foreignKey>
778 <field>
779 <name>organization_name</name>
780 <type>varchar</type>
781 <length>128</length>
782 <html>
783 <type>Text</type>
784 <size>30</size>
785 </html>
786 <import>true</import>
787 <headerPattern>/^organization|(o(rganization\s)?name)$/i</headerPattern>
788 <dataPattern>/^\w+$/</dataPattern>
789 <comment>Organization Name.</comment>
790 <fulltext/>
791 <add>1.1</add>
792 </field>
793 <index>
794 <name>index_organization_name</name>
795 <fieldName>organization_name</fieldName>
796 <add>1.8</add>
797 </index>
798 <field>
799 <name>sic_code</name>
800 <type>varchar</type>
801 <length>8</length>
802 <import>true</import>
803 <headerPattern>/^sic|(s(ic\s)?code)$/i</headerPattern>
804 <comment>Standard Industry Classification Code.</comment>
805 <add>1.1</add>
806 <html>
807 <type>Text</type>
808 </html>
809 </field>
810 <field>
811 <name>user_unique_id</name>
812 <rule>url</rule>
813 <title>Unique ID (OpenID)</title>
814 <type>varchar</type>
815 <length>255</length>
816 <import>true</import>
817 <headerPattern>/^Open\s?ID|u(niq\w*)?\s?ID/i</headerPattern>
818 <dataPattern>/^[\w\/\:\.]+$/</dataPattern>
819 <comment>the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM</comment>
820 <add>2.0</add>
821 <html>
822 <type>Text</type>
823 </html>
824 </field>
825 <field>
826 <name>employer_id</name>
827 <title>Current Employer</title>
828 <uniqueName>current_employer_id</uniqueName>
829 <type>int unsigned</type>
830 <comment>OPTIONAL FK to civicrm_contact record.</comment>
831 <export>true</export>
832 <add>2.1</add>
833 <html>
834 <type>EntityRef</type>
835 </html>
836 </field>
837 <foreignKey>
838 <name>employer_id</name>
839 <table>civicrm_contact</table>
840 <key>id</key>
841 <add>2.1</add>
842 <onDelete>SET NULL</onDelete>
843 </foreignKey>
844 <field>
845 <name>is_deleted</name>
846 <title>Contact is in Trash</title>
847 <uniqueName>contact_is_deleted</uniqueName>
848 <type>boolean</type>
849 <default>0</default>
850 <required>true</required>
851 <export>true</export>
852 <add>3.2</add>
853 <html>
854 <type>CheckBox</type>
855 </html>
856 </field>
857 <index>
858 <name>index_is_deleted</name>
859 <fieldName>is_deleted</fieldName>
860 <add>3.2</add>
861 <drop>4.4</drop>
862 </index>
863 <index>
864 <name>index_is_deleted_sort_name</name>
865 <fieldName>is_deleted</fieldName>
866 <fieldName>sort_name</fieldName>
867 <fieldName>id</fieldName>
868 <add>4.4</add>
869 </index>
870 <field>
871 <name>created_date</name>
872 <type>timestamp</type>
873 <comment>When was the contact was created.</comment>
874 <required>false</required>
875 <export>true</export>
876 <default>NULL</default>
877 <add>4.3</add>
878 </field>
879 <index>
880 <name>index_created_date</name>
881 <fieldName>created_date</fieldName>
882 <add>5.18</add>
883 </index>
884 <field>
885 <name>modified_date</name>
886 <type>timestamp</type>
887 <comment>When was the contact (or closely related entity) was created or modified or deleted.</comment>
888 <required>false</required>
889 <export>true</export>
890 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
891 <add>4.3</add>
892 </field>
893 <index>
894 <name>index_modified_date</name>
895 <fieldName>modified_date</fieldName>
896 <add>5.18</add>
897 </index>
898 </table>