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