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>Internal 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>
41 <name>index_contact_type
</name>
42 <fieldName>contact_type
</fieldName>
46 <name>contact_sub_type
</name>
47 <title>Contact Subtype
</title>
52 <headerPattern>/C(ontact )?(subtype|sub-type|sub type)/i
</headerPattern>
53 <comment>May be used to over-ride contact view and edit templates.
</comment>
55 <table>civicrm_contact_type
</table>
56 <keyColumn>name
</keyColumn>
57 <labelColumn>label
</labelColumn>
58 <condition>parent_id IS NOT NULL
</condition>
63 <name>index_contact_sub_type
</name>
64 <fieldName>contact_sub_type
</fieldName>
68 <name>do_not_email
</name>
71 <headerPattern>/d(o )?(not )?(email)/i
</headerPattern>
72 <dataPattern>/^\d{
1,}$/
</dataPattern>
77 <name>do_not_phone
</name>
81 <headerPattern>/d(o )?(not )?(call|phone)/i
</headerPattern>
82 <dataPattern>/^\d{
1,}$/
</dataPattern>
86 <name>do_not_mail
</name>
89 <headerPattern>/^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i
</headerPattern>
90 <dataPattern>/^\d{
1,}$/
</dataPattern>
95 <name>do_not_sms
</name>
98 <headerPattern>/d(o )?(not )?(sms)/i
</headerPattern>
99 <dataPattern>/^\d{
1,}$/
</dataPattern>
104 <name>do_not_trade
</name>
106 <import>true
</import>
107 <headerPattern>/d(o )?(not )?(trade)/i
</headerPattern>
108 <dataPattern>/^\d{
1,}$/
</dataPattern>
113 <name>is_opt_out
</name>
115 <title>No Bulk Emails (User Opt Out)
</title>
117 <import>true
</import>
118 <required>true
</required>
119 <comment>Has the contact opted out from receiving all bulk email from the organization or site domain?
</comment>
123 <name>legal_identifier
</name>
126 <import>true
</import>
127 <headerPattern>/legal\s?id/i
</headerPattern>
128 <dataPattern>/\w+?\d{
5,}/
</dataPattern>
129 <comment>May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.
</comment>
133 <name>external_identifier
</name>
137 <import>true
</import>
138 <headerPattern>/external\s?id/i
</headerPattern>
139 <dataPattern>/^\d{
11,}$/
</dataPattern>
140 <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.
</comment>
144 <name>UI_external_identifier
</name>
145 <unique>true
</unique>
146 <fieldName>external_identifier
</fieldName>
150 <name>sort_name
</name>
151 <title>Sort Name
</title>
155 <export>true
</export>
156 <comment>Name used for sorting different contact types
</comment>
160 <name>index_sort_name
</name>
161 <fieldName>sort_name
</fieldName>
165 <name>display_name
</name>
166 <title>Display Name
</title>
170 <export>true
</export>
171 <comment>Formatted name representing preferred format for display/print/other output.
</comment>
175 <name>nick_name
</name>
176 <title>Nickname
</title>
180 <import>true
</import>
181 <headerPattern>/n(ick\s)name|nick$/i
</headerPattern>
182 <dataPattern>/^\w+$/
</dataPattern>
183 <comment>Nickname.
</comment>
188 <name>legal_name
</name>
192 <import>true
</import>
193 <headerPattern>/^legal|(l(egal\s)?name)$/i
</headerPattern>
194 <comment>Legal Name.
</comment>
199 <name>home_URL
</name>
201 <title>Website
</title>
205 <import>true
</import>
206 <headerPattern>/^(home\sURL)|URL|web|site/i
</headerPattern>
207 <dataPattern>/^[\w\/\:\.]+$/
</dataPattern>
208 <comment>optional
"home page" URL for this contact.
</comment>
213 <name>image_URL
</name>
216 <import>true
</import>
217 <comment>optional URL for preferred image (photo, logo, etc.) to display for this contact.
</comment>
221 <name>preferred_communication_method
</name>
222 <title>Preferred Communication Method
</title>
225 <import>true
</import>
226 <headerPattern>/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i
</headerPattern>
227 <dataPattern>/^\w+$/
</dataPattern>
228 <comment>What is the preferred mode of communication.
</comment>
231 <optionGroupName>preferred_communication_method
</optionGroupName>
235 <name>index_preferred_communication_method
</name>
236 <fieldName>preferred_communication_method
</fieldName>
240 <name>preferred_language
</name>
241 <title>Preferred Language
</title>
244 <comment>Which language is preferred for communication. FK to languages in civicrm_option_value.
</comment>
245 <headerPattern>/^lang/i
</headerPattern>
246 <import>true
</import>
248 <optionGroupName>languages
</optionGroupName>
249 <keyColumn>name
</keyColumn>
254 <name>preferred_mail_format
</name>
256 <values>Text, HTML, Both
</values>
257 <default>"Both"</default>
258 <import>true
</import>
259 <headerPattern>/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i
</headerPattern>
260 <comment>What is the preferred mode of sending an email.
</comment>
265 <title>Contact Hash
</title>
268 <comment>Key for validating requests related to this contact.
</comment>
271 <export>true
</export>
274 <name>index_hash
</name>
275 <fieldName>hash
</fieldName>
282 <comment>API Key for validating requests related to this contact.
</comment>
286 <name>index_api_key
</name>
287 <fieldName>api_key
</fieldName>
292 <title>Source of Contact Data
</title>
293 <uniqueName>contact_source
</uniqueName>
297 <import>true
</import>
298 <headerPattern>/(S(ource\s)?o(f\s)?C(ontact\s)?Data)$/i
</headerPattern>
299 <comment>where contact come from, e.g. import, donate module insert...
</comment>
303 <name>first_name
</name>
307 <import>true
</import>
308 <headerPattern>/^first|(f(irst\s)?name)$/i
</headerPattern>
309 <dataPattern>/^\w+$/
</dataPattern>
311 <comment>First Name.
</comment>
315 <name>index_first_name
</name>
316 <fieldName>first_name
</fieldName>
320 <name>middle_name
</name>
324 <import>true
</import>
325 <headerPattern>/^middle|(m(iddle\s)?name)$/i
</headerPattern>
326 <dataPattern>/^\w+$/
</dataPattern>
328 <comment>Middle Name.
</comment>
332 <name>last_name
</name>
336 <import>true
</import>
337 <headerPattern>/^last|(l(ast\s)?name)$/i
</headerPattern>
338 <dataPattern>/^\w+(\s\w+)?+$/
</dataPattern>
339 <comment>Last Name.
</comment>
344 <name>index_last_name
</name>
345 <fieldName>last_name
</fieldName>
349 <name>prefix_id
</name>
350 <title>Individual Prefix
</title>
351 <type>int unsigned
</type>
352 <comment>Prefix or Title for name (Ms, Mr...). FK to prefix ID
</comment>
354 <optionGroupName>individual_prefix
</optionGroupName>
356 <headerPattern>/^(prefix|title)/i
</headerPattern>
357 <dataPattern>/^(mr|ms|mrs|sir|dr)\.?$/i
</dataPattern>
358 <import>true
</import>
362 <name>UI_prefix
</name>
363 <fieldName>prefix_id
</fieldName>
367 <name>suffix_id
</name>
368 <title>Individual Suffix
</title>
369 <type>int unsigned
</type>
371 <optionGroupName>individual_suffix
</optionGroupName>
373 <import>true
</import>
374 <comment>Suffix for name (Jr, Sr...). FK to suffix ID
</comment>
375 <headerPattern>/^suffix$/i
</headerPattern>
376 <dataPattern>/^(sr|jr)\.?|i{
2,}$/
</dataPattern>
380 <name>UI_suffix
</name>
381 <fieldName>suffix_id
</fieldName>
385 <name>greeting_type
</name>
388 <import>true
</import>
389 <comment>Preferred greeting format.
</comment>
394 <name>greeting_type_id
</name>
395 <title>Greeting Type
</title>
396 <type>int unsigned
</type>
397 <comment>FK to civicrm_option_value.id, that has to be valid, registered Greeting type.
</comment>
402 <name>custom_greeting
</name>
405 <import>true
</import>
406 <comment>Custom greeting message.
</comment>
411 <name>email_greeting_id
</name>
412 <type>int unsigned
</type>
413 <title>Email Greeting ID
</title>
414 <comment>FK to civicrm_option_value.id, that has to be valid registered Email Greeting.
</comment>
418 <name>email_greeting_custom
</name>
421 <import>true
</import>
422 <export>false
</export>
423 <comment>Custom Email Greeting.
</comment>
427 <name>email_greeting_display
</name>
428 <title>Email Greeting
</title>
431 <comment>Cache Email Greeting.
</comment>
435 <name>postal_greeting_id
</name>
436 <type>int unsigned
</type>
437 <title>Postal Greeting ID
</title>
438 <comment>FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.
</comment>
442 <name>postal_greeting_custom
</name>
445 <import>true
</import>
446 <export>false
</export>
447 <comment>Custom Postal greeting.
</comment>
451 <name>postal_greeting_display
</name>
452 <title>Postal Greeting
</title>
455 <comment>Cache Postal greeting.
</comment>
459 <name>addressee_id
</name>
460 <type>int unsigned
</type>
461 <title>Addressee ID
</title>
462 <comment>FK to civicrm_option_value.id, that has to be valid registered Addressee.
</comment>
466 <name>addressee_custom
</name>
469 <import>true
</import>
470 <export>false
</export>
471 <comment>Custom Addressee.
</comment>
475 <name>addressee_display
</name>
476 <title>Addressee
</title>
479 <comment>Cache Addressee.
</comment>
483 <name>job_title
</name>
487 <import>true
</import>
488 <headerPattern>/^job|(j(ob\s)?title)$/i
</headerPattern>
489 <dataPattern>//
</dataPattern>
490 <comment>Job Title
</comment>
494 <name>gender_id
</name>
495 <title>Gender
</title>
496 <type>int unsigned
</type>
498 <optionGroupName>gender
</optionGroupName>
500 <headerPattern>/^gender$/i
</headerPattern>
501 <comment>FK to gender ID
</comment>
502 <import>true
</import>
506 <name>UI_gender
</name>
507 <fieldName>gender_id
</fieldName>
511 <name>birth_date
</name>
513 <import>true
</import>
514 <headerPattern>/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i
</headerPattern>
515 <dataPattern>/\d{
4}-?\d{
2}-?\d{
2}/
</dataPattern>
516 <comment>Date of birth
</comment>
520 <name>is_deceased
</name>
521 <title>Is Deceased
</title>
522 <import>true
</import>
523 <export>true
</export>
524 <headerPattern>/i(s\s)?d(eceased)$/i
</headerPattern>
530 <name>deceased_date
</name>
532 <import>true
</import>
533 <export>true
</export>
534 <headerPattern>/^deceased|(d(eceased\s)?date)$/i
</headerPattern>
535 <comment>Date of deceased
</comment>
539 <name>mail_to_household_id
</name>
540 <title>Mail to Household ID
</title>
541 <type>int unsigned
</type>
542 <comment>OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location.
</comment>
543 <export>true
</export>
548 <name>mail_to_household_id
</name>
549 <table>civicrm_contact
</table>
552 <onDelete>SET NULL
</onDelete>
556 <name>household_name
</name>
560 <import>true
</import>
561 <headerPattern>/^household|(h(ousehold\s)?name)$/i
</headerPattern>
562 <dataPattern>/^\w+$/
</dataPattern>
563 <comment>Household Name.
</comment>
568 <name>index_household_name
</name>
569 <fieldName>household_name
</fieldName>
573 <name>primary_contact_id
</name>
574 <type>int unsigned
</type>
575 <title>Household Primary Contact ID
</title>
576 <comment>Optional FK to Primary Contact for this household.
</comment>
580 <name>primary_contact_id
</name>
581 <table>civicrm_contact
</table>
584 <onDelete>SET NULL
</onDelete>
587 <name>organization_name
</name>
591 <import>true
</import>
592 <headerPattern>/^organization|(o(rganization\s)?name)$/i
</headerPattern>
593 <dataPattern>/^\w+$/
</dataPattern>
594 <comment>Organization Name.
</comment>
599 <name>index_organization_name
</name>
600 <fieldName>organization_name
</fieldName>
604 <name>sic_code
</name>
607 <import>true
</import>
608 <headerPattern>/^sic|(s(ic\s)?code)$/i
</headerPattern>
609 <comment>Standard Industry Classification Code.
</comment>
613 <name>user_unique_id
</name>
615 <title>Unique ID (OpenID)
</title>
618 <import>true
</import>
619 <headerPattern>/^Open\s?ID|u(niq\w*)?\s?ID/i
</headerPattern>
620 <dataPattern>/^[\w\/\:\.]+$/
</dataPattern>
621 <comment>the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
</comment>
625 <name>employer_id
</name>
626 <title>Current Employer ID
</title>
627 <uniqueName>current_employer_id
</uniqueName>
628 <type>int unsigned
</type>
629 <comment>OPTIONAL FK to civicrm_contact record.
</comment>
630 <export>true
</export>
634 <name>employer_id
</name>
635 <table>civicrm_contact
</table>
638 <onDelete>SET NULL
</onDelete>
641 <name>is_deleted
</name>
642 <title>Contact is in Trash
</title>
643 <uniqueName>contact_is_deleted
</uniqueName>
646 <required>true
</required>
647 <export>true
</export>
651 <name>index_is_deleted
</name>
652 <fieldName>is_deleted
</fieldName>
657 <name>index_is_deleted_sort_name
</name>
658 <fieldName>is_deleted
</fieldName>
659 <fieldName>sort_name
</fieldName>
660 <fieldName>id
</fieldName>
664 <name>created_date
</name>
665 <type>timestamp
</type>
666 <comment>When was the contact was created.
</comment>
667 <required>false
</required>
668 <default>NULL
</default>
672 <name>modified_date
</name>
673 <type>timestamp
</type>
674 <comment>When was the contact (or closely related entity) was created or modified or deleted.
</comment>
675 <required>false
</required>
676 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
</default>