1 <?xml version=
"1.0" encoding=
"iso-8859-1" ?>
4 <base>CRM/Contact
</base>
6 <name>civicrm_contact
</name>
7 <comment>Contact objects are defined by a civicrm_contact record plus a related civicrm_contact_type record.
</comment>
12 <type>int unsigned
</type>
13 <title>Contact ID
</title>
15 <headerPattern>/internal|contact?|id$/i
</headerPattern>
16 <required>true
</required>
17 <comment>Unique Contact ID
</comment>
22 <autoincrement>true
</autoincrement>
25 <name>contact_type
</name>
26 <title>Contact Type
</title>
29 <comment>Type of Contact.
</comment>
32 <table>civicrm_contact_type
</table>
33 <keyColumn>name
</keyColumn>
34 <labelColumn>label
</labelColumn>
35 <condition>parent_id IS NULL
</condition>
44 <name>index_contact_type
</name>
45 <fieldName>contact_type
</fieldName>
49 <name>contact_sub_type
</name>
50 <title>Contact Subtype
</title>
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>
58 <table>civicrm_contact_type
</table>
59 <keyColumn>name
</keyColumn>
60 <labelColumn>label
</labelColumn>
61 <condition>parent_id IS NOT NULL
</condition>
65 <multiple>1</multiple>
70 <name>index_contact_sub_type
</name>
71 <fieldName>contact_sub_type
</fieldName>
75 <name>do_not_email
</name>
78 <headerPattern>/d(o )?(not )?(email)/i
</headerPattern>
79 <dataPattern>/^\d{
1,}$/
</dataPattern>
87 <name>do_not_phone
</name>
91 <headerPattern>/d(o )?(not )?(call|phone)/i
</headerPattern>
92 <dataPattern>/^\d{
1,}$/
</dataPattern>
99 <name>do_not_mail
</name>
101 <import>true
</import>
102 <headerPattern>/^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i
</headerPattern>
103 <dataPattern>/^\d{
1,}$/
</dataPattern>
107 <type>CheckBox
</type>
111 <name>do_not_sms
</name>
113 <import>true
</import>
114 <headerPattern>/d(o )?(not )?(sms)/i
</headerPattern>
115 <dataPattern>/^\d{
1,}$/
</dataPattern>
119 <type>CheckBox
</type>
123 <name>do_not_trade
</name>
125 <import>true
</import>
126 <headerPattern>/d(o )?(not )?(trade)/i
</headerPattern>
127 <dataPattern>/^\d{
1,}$/
</dataPattern>
131 <type>CheckBox
</type>
135 <name>is_opt_out
</name>
137 <title>No Bulk Emails (User Opt Out)
</title>
139 <import>true
</import>
140 <required>true
</required>
141 <comment>Has the contact opted out from receiving all bulk email from the organization or site domain?
</comment>
144 <type>CheckBox
</type>
148 <name>legal_identifier
</name>
151 <import>true
</import>
152 <headerPattern>/legal\s?id/i
</headerPattern>
153 <dataPattern>/\w+?\d{
5,}/
</dataPattern>
154 <comment>May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.
162 <name>external_identifier
</name>
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>
177 <name>UI_external_identifier
</name>
178 <unique>true
</unique>
179 <fieldName>external_identifier
</fieldName>
183 <name>sort_name
</name>
184 <title>Sort Name
</title>
192 <export>true
</export>
193 <comment>Name used for sorting different contact types
</comment>
197 <name>index_sort_name
</name>
198 <fieldName>sort_name
</fieldName>
202 <name>display_name
</name>
203 <title>Display Name
</title>
211 <export>true
</export>
212 <comment>Formatted name representing preferred format for display/print/other output.
</comment>
216 <name>nick_name
</name>
217 <title>Nickname
</title>
225 <import>true
</import>
226 <headerPattern>/n(ick\s)name|nick$/i
</headerPattern>
227 <dataPattern>/^\w+$/
</dataPattern>
228 <comment>Nickname.
</comment>
233 <name>legal_name
</name>
241 <import>true
</import>
242 <headerPattern>/^legal|(l(egal\s)?name)$/i
</headerPattern>
243 <comment>Legal Name.
</comment>
248 <name>home_URL
</name>
250 <title>Website
</title>
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>
266 <name>image_URL
</name>
269 <import>true
</import>
270 <comment>optional URL for preferred image (photo, logo, etc.) to display for this contact.
</comment>
278 <name>preferred_communication_method
</name>
279 <title>Preferred Communication Method
</title>
282 <import>true
</import>
283 <headerPattern>/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i
</headerPattern>
284 <dataPattern>/^\w+$/
</dataPattern>
285 <comment>What is the preferred mode of communication.
</comment>
288 <optionGroupName>preferred_communication_method
</optionGroupName>
295 <name>index_preferred_communication_method
</name>
296 <fieldName>preferred_communication_method
</fieldName>
300 <name>preferred_language
</name>
301 <title>Preferred Language
</title>
304 <comment>Which language is preferred for communication. FK to languages in civicrm_option_value.
</comment>
305 <headerPattern>/^lang/i
</headerPattern>
306 <import>true
</import>
308 <optionGroupName>languages
</optionGroupName>
309 <keyColumn>name
</keyColumn>
317 <name>preferred_mail_format
</name>
320 <default>"Both"</default>
321 <import>true
</import>
322 <headerPattern>/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i
</headerPattern>
323 <comment>What is the preferred mode of sending an email.
</comment>
326 <callback>CRM_Core_SelectValues::pmf
</callback>
334 <title>Contact Hash
</title>
337 <comment>Key for validating requests related to this contact.
</comment>
340 <export>true
</export>
343 <name>index_hash
</name>
344 <fieldName>hash
</fieldName>
351 <comment>API Key for validating requests related to this contact.
</comment>
355 <name>index_api_key
</name>
356 <fieldName>api_key
</fieldName>
361 <title>Contact Source
</title>
362 <uniqueName>contact_source
</uniqueName>
370 <import>true
</import>
371 <headerPattern>/(C(ontact\s)?Source)$/i
</headerPattern>
372 <comment>where contact come from, e.g. import, donate module insert...
</comment>
376 <name>first_name
</name>
383 <import>true
</import>
384 <headerPattern>/^first|(f(irst\s)?name)$/i
</headerPattern>
385 <dataPattern>/^\w+$/
</dataPattern>
387 <comment>First Name.
</comment>
391 <name>index_first_name
</name>
392 <fieldName>first_name
</fieldName>
396 <name>middle_name
</name>
403 <import>true
</import>
404 <headerPattern>/^middle|(m(iddle\s)?name)$/i
</headerPattern>
405 <dataPattern>/^\w+$/
</dataPattern>
407 <comment>Middle Name.
</comment>
411 <name>last_name
</name>
418 <import>true
</import>
419 <headerPattern>/^last|(l(ast\s)?name)$/i
</headerPattern>
420 <dataPattern>/^\w+(\s\w+)?+$/
</dataPattern>
421 <comment>Last Name.
</comment>
426 <name>index_last_name
</name>
427 <fieldName>last_name
</fieldName>
434 <name>prefix_id
</name>
435 <title>Individual Prefix
</title>
436 <type>int unsigned
</type>
437 <comment>Prefix or Title for name (Ms, Mr...). FK to prefix ID
</comment>
439 <optionGroupName>individual_prefix
</optionGroupName>
444 <headerPattern>/^(prefix|title)/i
</headerPattern>
445 <dataPattern>/^(mr|ms|mrs|sir|dr)\.?$/i
</dataPattern>
446 <import>true
</import>
450 <name>UI_prefix
</name>
451 <fieldName>prefix_id
</fieldName>
455 <name>suffix_id
</name>
456 <title>Individual Suffix
</title>
457 <type>int unsigned
</type>
459 <optionGroupName>individual_suffix
</optionGroupName>
464 <import>true
</import>
465 <comment>Suffix for name (Jr, Sr...). FK to suffix ID
</comment>
466 <headerPattern>/^suffix$/i
</headerPattern>
467 <dataPattern>/^(sr|jr)\.?|i{
2,}$/
</dataPattern>
471 <name>UI_suffix
</name>
472 <fieldName>suffix_id
</fieldName>
476 <name>formal_title
</name>
479 <import>true
</import>
480 <headerPattern>/^title/i
</headerPattern>
481 <comment>Formal (academic or similar) title in front of name. (Prof., Dr. etc.)
</comment>
485 <name>communication_style_id
</name>
486 <title>Communication Style
</title>
487 <type>int unsigned
</type>
489 <optionGroupName>communication_style
</optionGroupName>
491 <export>true
</export>
492 <comment>Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.
</comment>
499 <name>index_communication_style_id
</name>
500 <fieldName>communication_style_id
</fieldName>
504 <name>greeting_type
</name>
507 <import>true
</import>
508 <comment>Preferred greeting format.
</comment>
513 <name>greeting_type_id
</name>
514 <title>Greeting Type
</title>
515 <type>int unsigned
</type>
516 <comment>FK to civicrm_option_value.id, that has to be valid, registered Greeting type.
</comment>
521 <name>custom_greeting
</name>
524 <import>true
</import>
525 <comment>Custom greeting message.
</comment>
530 <name>email_greeting_id
</name>
531 <type>int unsigned
</type>
532 <title>Email Greeting ID
</title>
533 <comment>FK to civicrm_option_value.id, that has to be valid registered Email Greeting.
</comment>
537 <name>email_greeting_custom
</name>
540 <import>true
</import>
541 <export>false
</export>
542 <comment>Custom Email Greeting.
</comment>
549 <name>email_greeting_display
</name>
550 <title>Email Greeting
</title>
553 <comment>Cache Email Greeting.
</comment>
560 <name>postal_greeting_id
</name>
561 <type>int unsigned
</type>
562 <title>Postal Greeting ID
</title>
563 <comment>FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.
</comment>
570 <name>postal_greeting_custom
</name>
573 <import>true
</import>
574 <export>false
</export>
575 <comment>Custom Postal greeting.
</comment>
582 <name>postal_greeting_display
</name>
583 <title>Postal Greeting
</title>
586 <comment>Cache Postal greeting.
</comment>
593 <name>addressee_id
</name>
594 <type>int unsigned
</type>
595 <title>Addressee ID
</title>
596 <comment>FK to civicrm_option_value.id, that has to be valid registered Addressee.
</comment>
600 <name>addressee_custom
</name>
603 <import>true
</import>
604 <export>false
</export>
605 <comment>Custom Addressee.
</comment>
612 <name>addressee_display
</name>
613 <title>Addressee
</title>
616 <comment>Cache Addressee.
</comment>
623 <name>job_title
</name>
630 <import>true
</import>
631 <headerPattern>/^job|(j(ob\s)?title)$/i
</headerPattern>
632 <dataPattern>//
</dataPattern>
633 <comment>Job Title
</comment>
637 <name>gender_id
</name>
638 <title>Gender
</title>
639 <type>int unsigned
</type>
641 <optionGroupName>gender
</optionGroupName>
646 <headerPattern>/^gender$/i
</headerPattern>
647 <comment>FK to gender ID
</comment>
648 <import>true
</import>
652 <name>UI_gender
</name>
653 <fieldName>gender_id
</fieldName>
660 <name>birth_date
</name>
662 <import>true
</import>
663 <headerPattern>/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i
</headerPattern>
664 <dataPattern>/\d{
4}-?\d{
2}-?\d{
2}/
</dataPattern>
665 <comment>Date of birth
</comment>
668 <type>Select Date
</type>
672 <name>is_deceased
</name>
673 <title>Deceased
</title>
674 <import>true
</import>
675 <export>true
</export>
676 <headerPattern>/i(s\s)?d(eceased)$/i
</headerPattern>
681 <type>CheckBox
</type>
685 <name>deceased_date
</name>
687 <import>true
</import>
688 <export>true
</export>
689 <headerPattern>/^deceased|(d(eceased\s)?date)$/i
</headerPattern>
690 <comment>Date of deceased
</comment>
693 <type>Select Date
</type>
697 <name>mail_to_household_id
</name>
698 <title>Mail to Household ID
</title>
699 <type>int unsigned
</type>
700 <comment>OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location.
</comment>
701 <export>true
</export>
706 <name>mail_to_household_id
</name>
707 <table>civicrm_contact
</table>
710 <onDelete>SET NULL
</onDelete>
714 <name>household_name
</name>
721 <import>true
</import>
722 <headerPattern>/^household|(h(ousehold\s)?name)$/i
</headerPattern>
723 <dataPattern>/^\w+$/
</dataPattern>
724 <comment>Household Name.
</comment>
729 <name>index_household_name
</name>
730 <fieldName>household_name
</fieldName>
734 <name>primary_contact_id
</name>
735 <type>int unsigned
</type>
736 <title>Household Primary Contact ID
</title>
737 <comment>Optional FK to Primary Contact for this household.
</comment>
744 <name>primary_contact_id
</name>
745 <table>civicrm_contact
</table>
748 <onDelete>SET NULL
</onDelete>
751 <name>organization_name
</name>
758 <import>true
</import>
759 <headerPattern>/^organization|(o(rganization\s)?name)$/i
</headerPattern>
760 <dataPattern>/^\w+$/
</dataPattern>
761 <comment>Organization Name.
</comment>
766 <name>index_organization_name
</name>
767 <fieldName>organization_name
</fieldName>
771 <name>sic_code
</name>
774 <import>true
</import>
775 <headerPattern>/^sic|(s(ic\s)?code)$/i
</headerPattern>
776 <comment>Standard Industry Classification Code.
</comment>
783 <name>user_unique_id
</name>
785 <title>Unique ID (OpenID)
</title>
788 <import>true
</import>
789 <headerPattern>/^Open\s?ID|u(niq\w*)?\s?ID/i
</headerPattern>
790 <dataPattern>/^[\w\/\:\.]+$/
</dataPattern>
791 <comment>the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
</comment>
798 <name>employer_id
</name>
799 <title>Current Employer
</title>
800 <uniqueName>current_employer_id
</uniqueName>
801 <type>int unsigned
</type>
802 <comment>OPTIONAL FK to civicrm_contact record.
</comment>
803 <export>true
</export>
806 <type>EntityRef
</type>
810 <name>employer_id
</name>
811 <table>civicrm_contact
</table>
814 <onDelete>SET NULL
</onDelete>
817 <name>is_deleted
</name>
818 <title>Contact is in Trash
</title>
819 <uniqueName>contact_is_deleted
</uniqueName>
822 <required>true
</required>
823 <export>true
</export>
826 <type>CheckBox
</type>
830 <name>index_is_deleted
</name>
831 <fieldName>is_deleted
</fieldName>
836 <name>index_is_deleted_sort_name
</name>
837 <fieldName>is_deleted
</fieldName>
838 <fieldName>sort_name
</fieldName>
839 <fieldName>id
</fieldName>
843 <name>created_date
</name>
844 <type>timestamp
</type>
845 <comment>When was the contact was created.
</comment>
846 <required>false
</required>
847 <export>true
</export>
848 <default>NULL
</default>
852 <name>modified_date
</name>
853 <type>timestamp
</type>
854 <comment>When was the contact (or closely related entity) was created or modified or deleted.
</comment>
855 <required>false
</required>
856 <export>true
</export>
857 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
</default>