Table d45civi_b72v5.civicrm_contact Generated by
SchemaSpy
Legend: SourceForge.net
Primary key columns
Columns with indexes
Implied relationships
Excluded column relationships
< n > number of related tables
 
Column Type Size Nulls Auto Default Children Parents Comments
id int unsigned 10  √ 
civicrm_acl_cache.contact_id FK_civicrm_acl_cache_contact_id C
civicrm_acl_contact_cache.contact_id FK_civicrm_acl_contact_cache_contact_id C
civicrm_acl_contact_cache.user_id FK_civicrm_acl_contact_cache_user_id C
civicrm_action_log.contact_id FK_civicrm_action_log_contact_id C
civicrm_activity_contact.contact_id FK_civicrm_activity_contact_contact_id C
civicrm_address.contact_id FK_civicrm_address_contact_id C
civicrm_batch.created_id FK_civicrm_batch_created_id N
civicrm_batch.modified_id FK_civicrm_batch_modified_id N
civicrm_campaign.created_id FK_civicrm_campaign_created_id N
civicrm_campaign.last_modified_id FK_civicrm_campaign_last_modified_id N
civicrm_case_contact.contact_id FK_civicrm_case_contact_contact_id C
civicrm_contact.employer_id FK_civicrm_contact_employer_id N
civicrm_contact.primary_contact_id FK_civicrm_contact_primary_contact_id N
civicrm_contribution.contact_id FK_civicrm_contribution_contact_id C
civicrm_contribution_page.created_id FK_civicrm_contribution_page_created_id N
civicrm_contribution_recur.contact_id FK_civicrm_contribution_recur_contact_id C
civicrm_contribution_soft.contact_id FK_civicrm_contribution_soft_contact_id C
civicrm_custom_group.created_id FK_civicrm_custom_group_created_id N
civicrm_dashboard_contact.contact_id FK_civicrm_dashboard_contact_contact_id C
civicrm_dedupe_exception.contact_id1 FK_civicrm_dedupe_exception_contact_id1 C
civicrm_dedupe_exception.contact_id2 FK_civicrm_dedupe_exception_contact_id2 C
civicrm_domain.contact_id FK_civicrm_domain_contact_id R
civicrm_email.contact_id FK_civicrm_email_contact_id C
civicrm_event.created_id FK_civicrm_event_created_id N
civicrm_event_carts.user_id FK_civicrm_event_carts_user_id N
civicrm_financial_account.contact_id FK_civicrm_financial_account_contact_id N
civicrm_financial_item.contact_id FK_civicrm_financial_item_contact_id C
civicrm_grant.contact_id FK_civicrm_grant_contact_id C
civicrm_group.created_id FK_civicrm_group_created_id N
civicrm_group.modified_id FK_civicrm_group_modified_id N
civicrm_group_contact.contact_id FK_civicrm_group_contact_contact_id C
civicrm_group_contact_cache.contact_id FK_civicrm_group_contact_cache_contact_id C
civicrm_group_organization.organization_id FK_civicrm_group_organization_organization_id C
civicrm_im.contact_id FK_civicrm_im_contact_id C
civicrm_log.modified_id FK_civicrm_log_modified_id C
civicrm_mailing.approver_id FK_civicrm_mailing_approver_id N
civicrm_mailing.created_id FK_civicrm_mailing_created_id N
civicrm_mailing.scheduled_id FK_civicrm_mailing_scheduled_id N
civicrm_mailing_event_queue.contact_id FK_civicrm_mailing_event_queue_contact_id C
civicrm_mailing_event_subscribe.contact_id FK_civicrm_mailing_event_subscribe_contact_id C
civicrm_mailing_recipients.contact_id FK_civicrm_mailing_recipients_contact_id C
civicrm_membership.contact_id FK_civicrm_membership_contact_id C
civicrm_membership_log.modified_id FK_civicrm_membership_log_modified_id N
civicrm_membership_type.member_of_contact_id FK_civicrm_membership_type_member_of_contact_id R
civicrm_note.contact_id FK_civicrm_note_contact_id N
civicrm_openid.contact_id FK_civicrm_openid_contact_id C
civicrm_participant.contact_id FK_civicrm_participant_contact_id C
civicrm_pcp.contact_id FK_civicrm_pcp_contact_id C
civicrm_phone.contact_id FK_civicrm_phone_contact_id C
civicrm_pledge.contact_id FK_civicrm_pledge_contact_id C
civicrm_print_label.created_id FK_civicrm_print_label_created_id N
civicrm_relationship.contact_id_a FK_civicrm_relationship_contact_id_a C
civicrm_relationship.contact_id_b FK_civicrm_relationship_contact_id_b C
civicrm_setting.contact_id FK_civicrm_setting_contact_id C
civicrm_setting.created_id FK_civicrm_setting_created_id N
civicrm_subscription_history.contact_id FK_civicrm_subscription_history_contact_id C
civicrm_survey.created_id FK_civicrm_survey_created_id N
civicrm_survey.last_modified_id FK_civicrm_survey_last_modified_id N
civicrm_tag.created_id FK_civicrm_tag_created_id N
civicrm_uf_group.created_id FK_civicrm_uf_group_created_id N
civicrm_uf_match.contact_id FK_civicrm_uf_match_contact_id C
civicrm_value_constituent_information_1.entity_id FK_civicrm_value_constituent_information_1_entity_id C
civicrm_value_volunteer_information_5.entity_id FK_civicrm_value_volunteer_information_5_entity_id C
civicrm_volunteer_project.target_contact_id FK_civicrm_volunteer_project_target_contact_id N
civicrm_website.contact_id FK_civicrm_website_contact_id C
Unique Contact ID
contact_type varchar 64  √  null Type of Contact.
contact_sub_type varchar 255  √  null May be used to over-ride contact view and edit templates.
do_not_email tinyint 3  √  0
do_not_phone tinyint 3  √  0
do_not_mail tinyint 3  √  0
do_not_sms tinyint 3  √  0
do_not_trade tinyint 3  √  0
is_opt_out tinyint 3 0 Has the contact opted out from receiving all bulk email from the organization or site domain?
legal_identifier varchar 32  √  null May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.
external_identifier varchar 32  √  null Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.
sort_name varchar 128  √  null Name used for sorting different contact types
display_name varchar 128  √  null Formatted name representing preferred format for display/print/other output.
nick_name varchar 128  √  null Nickname.
legal_name varchar 128  √  null Legal Name.
image_URL varchar 255  √  null optional URL for preferred image (photo, logo, etc.) to display for this contact.
preferred_communication_method varchar 255  √  null What is the preferred mode of communication.
preferred_language varchar 5  √  null Which language is preferred for communication. FK to languages in civicrm_option_value.
preferred_mail_format varchar 8  √  Both What is the preferred mode of sending an email.
hash varchar 32  √  null Key for validating requests related to this contact.
api_key varchar 32  √  null API Key for validating requests related to this contact.
source varchar 255  √  null where contact come from, e.g. import, donate module insert...
first_name varchar 64  √  null First Name.
middle_name varchar 64  √  null Middle Name.
last_name varchar 64  √  null Last Name.
prefix_id int unsigned 10  √  null Prefix or Title for name (Ms, Mr...). FK to prefix ID
suffix_id int unsigned 10  √  null Suffix for name (Jr, Sr...). FK to suffix ID
formal_title varchar 64  √  null Formal (academic or similar) title in front of name. (Prof., Dr. etc.)
communication_style_id int unsigned 10  √  null Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.
email_greeting_id int unsigned 10  √  null FK to civicrm_option_value.id, that has to be valid registered Email Greeting.
email_greeting_custom varchar 128  √  null Custom Email Greeting.
email_greeting_display varchar 255  √  null Cache Email Greeting.
postal_greeting_id int unsigned 10  √  null FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.
postal_greeting_custom varchar 128  √  null Custom Postal greeting.
postal_greeting_display varchar 255  √  null Cache Postal greeting.
addressee_id int unsigned 10  √  null FK to civicrm_option_value.id, that has to be valid registered Addressee.
addressee_custom varchar 128  √  null Custom Addressee.
addressee_display varchar 255  √  null Cache Addressee.
job_title varchar 255  √  null Job Title
gender_id int unsigned 10  √  null FK to gender ID
birth_date date 10  √  null Date of birth
is_deceased tinyint 3  √  0
deceased_date date 10  √  null Date of deceased
household_name varchar 128  √  null Household Name.
primary_contact_id int unsigned 10  √  null
civicrm_contact.id FK_civicrm_contact_primary_contact_id N
Optional FK to Primary Contact for this household.
organization_name varchar 128  √  null Organization Name.
sic_code varchar 8  √  null Standard Industry Classification Code.
user_unique_id varchar 255  √  null the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
employer_id int unsigned 10  √  null
civicrm_contact.id FK_civicrm_contact_employer_id N
OPTIONAL FK to civicrm_contact record.
is_deleted tinyint 3 0
created_date timestamp 19  √  null When was the contact was created.
modified_date timestamp 19  √  CURRENT_TIMESTAMP When was the contact (or closely related entity) was created or modified or deleted.

Table contained 201 rows at Wed Nov 11 17:12 EST 2015

Indexes:
Column(s) Type Sort Constraint Name Anomalies
id Primary key Asc PRIMARY  
employer_id Performance Asc FK_civicrm_contact_employer_id  
primary_contact_id Performance Asc FK_civicrm_contact_primary_contact_id  
api_key Performance Asc index_api_key  
communication_style_id Performance Asc index_communication_style_id  
contact_sub_type Performance Asc index_contact_sub_type  
contact_type Performance Asc index_contact_type  
first_name Performance Asc index_first_name  
hash Performance Asc index_hash  
household_name Performance Asc index_household_name  
is_deleted + sort_name + id Performance Asc/Asc/Asc index_is_deleted_sort_name  
last_name Performance Asc index_last_name  
organization_name Performance Asc index_organization_name  
preferred_communication_method Performance Asc index_preferred_communication_method  
sort_name Performance Asc index_sort_name  
external_identifier Must be unique Asc UI_external_identifier This unique column is also nullable
gender_id Performance Asc UI_gender  
prefix_id Performance Asc UI_prefix  
suffix_id Performance Asc UI_suffix  

Close relationships  within of separation: