civicrm_contact

3 rows


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id INT UNSIGNED 10 null
civicrm_acl_cache.contact_id FK_civicrm_acl_cache_contact_idC
civicrm_acl_contact_cache.contact_id FK_civicrm_acl_contact_cache_contact_idC
civicrm_acl_contact_cache.user_id FK_civicrm_acl_contact_cache_user_idC
civicrm_action_log.contact_id FK_civicrm_action_log_contact_idC
civicrm_activity_contact.contact_id FK_civicrm_activity_contact_contact_idC
civicrm_address.contact_id FK_civicrm_address_contact_idC
civicrm_batch.created_id FK_civicrm_batch_created_idN
civicrm_batch.modified_id FK_civicrm_batch_modified_idN
civicrm_campaign.created_id FK_civicrm_campaign_created_idN
civicrm_campaign.last_modified_id FK_civicrm_campaign_last_modified_idN
civicrm_case_contact.contact_id FK_civicrm_case_contact_contact_idC
civicrm_contact.employer_id FK_civicrm_contact_employer_idN
civicrm_contact.primary_contact_id FK_civicrm_contact_primary_contact_idN
civicrm_contribution.contact_id FK_civicrm_contribution_contact_idC
civicrm_contribution_page.created_id FK_civicrm_contribution_page_created_idN
civicrm_contribution_recur.contact_id FK_civicrm_contribution_recur_contact_idC
civicrm_contribution_soft.contact_id FK_civicrm_contribution_soft_contact_idC
civicrm_custom_group.created_id FK_civicrm_custom_group_created_idN
civicrm_dashboard_contact.contact_id FK_civicrm_dashboard_contact_contact_idC
civicrm_dedupe_exception.contact_id1 FK_civicrm_dedupe_exception_contact_id1C
civicrm_dedupe_exception.contact_id2 FK_civicrm_dedupe_exception_contact_id2C
civicrm_domain.contact_id FK_civicrm_domain_contact_idR
civicrm_email.contact_id FK_civicrm_email_contact_idC
civicrm_event.created_id FK_civicrm_event_created_idN
civicrm_event_carts.user_id FK_civicrm_event_carts_user_idN
civicrm_file.created_id FK_civicrm_file_created_idN
civicrm_financial_account.contact_id FK_civicrm_financial_account_contact_idN
civicrm_financial_item.contact_id FK_civicrm_financial_item_contact_idC
civicrm_grant.contact_id FK_civicrm_grant_contact_idC
civicrm_group.created_id FK_civicrm_group_created_idN
civicrm_group.modified_id FK_civicrm_group_modified_idN
civicrm_group_contact.contact_id FK_civicrm_group_contact_contact_idC
civicrm_group_contact_cache.contact_id FK_civicrm_group_contact_cache_contact_idC
civicrm_group_organization.organization_id FK_civicrm_group_organization_organization_idC
civicrm_im.contact_id FK_civicrm_im_contact_idC
civicrm_log.modified_id FK_civicrm_log_modified_idC
civicrm_mailing.approver_id FK_civicrm_mailing_approver_idN
civicrm_mailing.created_id FK_civicrm_mailing_created_idN
civicrm_mailing.scheduled_id FK_civicrm_mailing_scheduled_idN
civicrm_mailing_abtest.created_id FK_civicrm_mailing_abtest_created_idN
civicrm_mailing_event_queue.contact_id FK_civicrm_mailing_event_queue_contact_idC
civicrm_mailing_event_subscribe.contact_id FK_civicrm_mailing_event_subscribe_contact_idC
civicrm_mailing_recipients.contact_id FK_civicrm_mailing_recipients_contact_idC
civicrm_membership.contact_id FK_civicrm_membership_contact_idC
civicrm_membership_log.modified_id FK_civicrm_membership_log_modified_idN
civicrm_membership_type.member_of_contact_id FK_civicrm_membership_type_member_of_contact_idR
civicrm_note.contact_id FK_civicrm_note_contact_idN
civicrm_openid.contact_id FK_civicrm_openid_contact_idC
civicrm_participant.contact_id FK_civicrm_participant_contact_idC
civicrm_participant.transferred_to_contact_id FK_civicrm_participant_transferred_to_contact_idN
civicrm_payment_token.contact_id FK_civicrm_payment_token_contact_idC
civicrm_payment_token.created_id FK_civicrm_payment_token_created_idN
civicrm_pcp.contact_id FK_civicrm_pcp_contact_idC
civicrm_phone.contact_id FK_civicrm_phone_contact_idC
civicrm_pledge.contact_id FK_civicrm_pledge_contact_idC
civicrm_print_label.created_id FK_civicrm_print_label_created_idN
civicrm_relationship.contact_id_a FK_civicrm_relationship_contact_id_aC
civicrm_relationship.contact_id_b FK_civicrm_relationship_contact_id_bC
civicrm_report_instance.created_id FK_civicrm_report_instance_created_idN
civicrm_report_instance.owner_id FK_civicrm_report_instance_owner_idN
civicrm_setting.contact_id FK_civicrm_setting_contact_idC
civicrm_setting.created_id FK_civicrm_setting_created_idN
civicrm_subscription_history.contact_id FK_civicrm_subscription_history_contact_idC
civicrm_survey.created_id FK_civicrm_survey_created_idN
civicrm_survey.last_modified_id FK_civicrm_survey_last_modified_idN
civicrm_tag.created_id FK_civicrm_tag_created_idN
civicrm_uf_group.created_id FK_civicrm_uf_group_created_idN
civicrm_uf_match.contact_id FK_civicrm_uf_match_contact_idC
civicrm_value_informations__1.entity_id FK_civicrm_value_informations__1_entity_idC
civicrm_website.contact_id FK_civicrm_website_contact_idC

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 64 null
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 TEXT 65535 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_idN

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_idN

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.

Indexes

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

Relationships