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>
250 <name>preferred_mail_format
</name>
252 <values>Text, HTML, Both
</values>
253 <default>"Both"</default>
254 <import>true
</import>
255 <headerPattern>/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i
</headerPattern>
256 <comment>What is the preferred mode of sending an email.
</comment>
261 <title>Contact Hash
</title>
264 <comment>Key for validating requests related to this contact.
</comment>
267 <export>true
</export>
270 <name>index_hash
</name>
271 <fieldName>hash
</fieldName>
278 <comment>API Key for validating requests related to this contact.
</comment>
282 <name>index_api_key
</name>
283 <fieldName>api_key
</fieldName>
288 <title>Source of Contact Data
</title>
289 <uniqueName>contact_source
</uniqueName>
293 <import>true
</import>
294 <headerPattern>/(S(ource\s)?o(f\s)?C(ontact\s)?Data)$/i
</headerPattern>
295 <comment>where contact come from, e.g. import, donate module insert...
</comment>
299 <name>first_name
</name>
303 <import>true
</import>
304 <headerPattern>/^first|(f(irst\s)?name)$/i
</headerPattern>
305 <dataPattern>/^\w+$/
</dataPattern>
307 <comment>First Name.
</comment>
311 <name>index_first_name
</name>
312 <fieldName>first_name
</fieldName>
316 <name>middle_name
</name>
320 <import>true
</import>
321 <headerPattern>/^middle|(m(iddle\s)?name)$/i
</headerPattern>
322 <dataPattern>/^\w+$/
</dataPattern>
324 <comment>Middle Name.
</comment>
328 <name>last_name
</name>
332 <import>true
</import>
333 <headerPattern>/^last|(l(ast\s)?name)$/i
</headerPattern>
334 <dataPattern>/^\w+(\s\w+)?+$/
</dataPattern>
335 <comment>Last Name.
</comment>
340 <name>index_last_name
</name>
341 <fieldName>last_name
</fieldName>
345 <name>prefix_id
</name>
346 <title>Individual Prefix
</title>
347 <type>int unsigned
</type>
348 <comment>Prefix or Title for name (Ms, Mr...). FK to prefix ID
</comment>
350 <optionGroupName>individual_prefix
</optionGroupName>
352 <headerPattern>/^(prefix|title)/i
</headerPattern>
353 <dataPattern>/^(mr|ms|mrs|sir|dr)\.?$/i
</dataPattern>
354 <import>true
</import>
358 <name>UI_prefix
</name>
359 <fieldName>prefix_id
</fieldName>
363 <name>suffix_id
</name>
364 <title>Individual Suffix
</title>
365 <type>int unsigned
</type>
367 <optionGroupName>individual_suffix
</optionGroupName>
369 <import>true
</import>
370 <comment>Suffix for name (Jr, Sr...). FK to suffix ID
</comment>
371 <headerPattern>/^suffix$/i
</headerPattern>
372 <dataPattern>/^(sr|jr)\.?|i{
2,}$/
</dataPattern>
376 <name>UI_suffix
</name>
377 <fieldName>suffix_id
</fieldName>
381 <name>greeting_type
</name>
384 <import>true
</import>
385 <comment>Preferred greeting format.
</comment>
390 <name>greeting_type_id
</name>
391 <title>Greeting Type
</title>
392 <type>int unsigned
</type>
393 <comment>FK to civicrm_option_value.id, that has to be valid, registered Greeting type.
</comment>
398 <name>custom_greeting
</name>
401 <import>true
</import>
402 <comment>Custom greeting message.
</comment>
407 <name>email_greeting_id
</name>
408 <type>int unsigned
</type>
409 <title>Email Greeting ID
</title>
410 <comment>FK to civicrm_option_value.id, that has to be valid registered Email Greeting.
</comment>
414 <name>email_greeting_custom
</name>
417 <import>true
</import>
418 <export>false
</export>
419 <comment>Custom Email Greeting.
</comment>
423 <name>email_greeting_display
</name>
424 <title>Email Greeting
</title>
427 <comment>Cache Email Greeting.
</comment>
431 <name>postal_greeting_id
</name>
432 <type>int unsigned
</type>
433 <title>Postal Greeting ID
</title>
434 <comment>FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.
</comment>
438 <name>postal_greeting_custom
</name>
441 <import>true
</import>
442 <export>false
</export>
443 <comment>Custom Postal greeting.
</comment>
447 <name>postal_greeting_display
</name>
448 <title>Postal Greeting
</title>
451 <comment>Cache Postal greeting.
</comment>
455 <name>addressee_id
</name>
456 <type>int unsigned
</type>
457 <title>Addressee ID
</title>
458 <comment>FK to civicrm_option_value.id, that has to be valid registered Addressee.
</comment>
462 <name>addressee_custom
</name>
465 <import>true
</import>
466 <export>false
</export>
467 <comment>Custom Addressee.
</comment>
471 <name>addressee_display
</name>
472 <title>Addressee
</title>
475 <comment>Cache Addressee.
</comment>
479 <name>job_title
</name>
483 <import>true
</import>
484 <headerPattern>/^job|(j(ob\s)?title)$/i
</headerPattern>
485 <dataPattern>//
</dataPattern>
486 <comment>Job Title
</comment>
490 <name>gender_id
</name>
491 <title>Gender
</title>
492 <type>int unsigned
</type>
494 <optionGroupName>gender
</optionGroupName>
496 <headerPattern>/^gender$/i
</headerPattern>
497 <comment>FK to gender ID
</comment>
498 <import>true
</import>
502 <name>UI_gender
</name>
503 <fieldName>gender_id
</fieldName>
507 <name>birth_date
</name>
509 <import>true
</import>
510 <headerPattern>/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i
</headerPattern>
511 <dataPattern>/\d{
4}-?\d{
2}-?\d{
2}/
</dataPattern>
512 <comment>Date of birth
</comment>
516 <name>is_deceased
</name>
517 <title>Is Deceased
</title>
518 <import>true
</import>
519 <export>true
</export>
520 <headerPattern>/i(s\s)?d(eceased)$/i
</headerPattern>
526 <name>deceased_date
</name>
528 <import>true
</import>
529 <export>true
</export>
530 <headerPattern>/^deceased|(d(eceased\s)?date)$/i
</headerPattern>
531 <comment>Date of deceased
</comment>
535 <name>mail_to_household_id
</name>
536 <title>Mail to Household ID
</title>
537 <type>int unsigned
</type>
538 <comment>OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location.
</comment>
539 <export>true
</export>
544 <name>mail_to_household_id
</name>
545 <table>civicrm_contact
</table>
548 <onDelete>SET NULL
</onDelete>
552 <name>household_name
</name>
556 <import>true
</import>
557 <headerPattern>/^household|(h(ousehold\s)?name)$/i
</headerPattern>
558 <dataPattern>/^\w+$/
</dataPattern>
559 <comment>Household Name.
</comment>
564 <name>index_household_name
</name>
565 <fieldName>household_name
</fieldName>
569 <name>primary_contact_id
</name>
570 <type>int unsigned
</type>
571 <title>Household Primary Contact ID
</title>
572 <comment>Optional FK to Primary Contact for this household.
</comment>
576 <name>primary_contact_id
</name>
577 <table>civicrm_contact
</table>
580 <onDelete>SET NULL
</onDelete>
583 <name>organization_name
</name>
587 <import>true
</import>
588 <headerPattern>/^organization|(o(rganization\s)?name)$/i
</headerPattern>
589 <dataPattern>/^\w+$/
</dataPattern>
590 <comment>Organization Name.
</comment>
595 <name>index_organization_name
</name>
596 <fieldName>organization_name
</fieldName>
600 <name>sic_code
</name>
603 <import>true
</import>
604 <headerPattern>/^sic|(s(ic\s)?code)$/i
</headerPattern>
605 <comment>Standard Industry Classification Code.
</comment>
609 <name>user_unique_id
</name>
611 <title>Unique ID (OpenID)
</title>
614 <import>true
</import>
615 <headerPattern>/^Open\s?ID|u(niq\w*)?\s?ID/i
</headerPattern>
616 <dataPattern>/^[\w\/\:\.]+$/
</dataPattern>
617 <comment>the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
</comment>
621 <name>employer_id
</name>
622 <title>Current Employer ID
</title>
623 <uniqueName>current_employer_id
</uniqueName>
624 <type>int unsigned
</type>
625 <comment>OPTIONAL FK to civicrm_contact record.
</comment>
626 <export>true
</export>
630 <name>employer_id
</name>
631 <table>civicrm_contact
</table>
634 <onDelete>SET NULL
</onDelete>
637 <name>is_deleted
</name>
638 <title>Contact is in Trash
</title>
639 <uniqueName>contact_is_deleted
</uniqueName>
642 <required>true
</required>
643 <export>true
</export>
647 <name>index_is_deleted
</name>
648 <fieldName>is_deleted
</fieldName>
653 <name>index_is_deleted_sort_name
</name>
654 <fieldName>is_deleted
</fieldName>
655 <fieldName>sort_name
</fieldName>
656 <fieldName>id
</fieldName>
660 <name>created_date
</name>
661 <type>timestamp
</type>
662 <comment>When was the contact was created.
</comment>
663 <required>false
</required>
664 <default>NULL
</default>
668 <name>modified_date
</name>
669 <type>timestamp
</type>
670 <comment>When was the contact (or closely related entity) was created or modified or deleted.
</comment>
671 <required>false
</required>
672 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
</default>