Table d47civi_0z3xa.civicrm_contribution 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_contribution_product.contribution_id FK_civicrm_contribution_product_contribution_id C
civicrm_contribution_soft.contribution_id FK_civicrm_contribution_soft_contribution_id C
civicrm_line_item.contribution_id FK_civicrm_line_item_contribution_id N
civicrm_membership_payment.contribution_id FK_civicrm_membership_payment_contribution_id C
civicrm_participant_payment.contribution_id FK_civicrm_participant_payment_contribution_id C
civicrm_pledge_payment.contribution_id FK_civicrm_pledge_payment_contribution_id C
cividiscount_track.contribution_id FK_cividiscount_track_contribution_id C
Contribution ID
contact_id int unsigned 10
civicrm_contact.id FK_civicrm_contribution_contact_id C
FK to Contact ID
financial_type_id int unsigned 10  √  null
civicrm_financial_type.id FK_civicrm_contribution_financial_type_id R
FK to Financial Type for (total_amount - non_deductible_amount).
contribution_page_id int unsigned 10  √  null
civicrm_contribution_page.id FK_civicrm_contribution_contribution_page_id N
The Contribution Page which triggered this contribution
payment_instrument_id int unsigned 10  √  null FK to Payment Instrument
receive_date datetime 19  √  null Date contribution was received - not necessarily the creation date of the record
non_deductible_amount decimal 20,2  √  0.00 Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.
total_amount decimal 20,2 Total amount of this contribution. Use market value for non-monetary gifts.
fee_amount decimal 20,2  √  null actual processor fee if known - may be 0.
net_amount decimal 20,2  √  null actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.
trxn_id varchar 255  √  null unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
invoice_id varchar 255  √  null unique invoice id, system generated or passed in
currency varchar 3  √  null 3 character string, value from config setting or input via user.
cancel_date datetime 19  √  null when was gift cancelled
cancel_reason text 65535  √  null
receipt_date datetime 19  √  null when (if) receipt was sent. populated automatically for online donations w/ automatic receipting
thankyou_date datetime 19  √  null when (if) was donor thanked
source varchar 255  √  null Origin of this Contribution.
amount_level text 65535  √  null
contribution_recur_id int unsigned 10  √  null
civicrm_contribution_recur.id FK_civicrm_contribution_contribution_recur_id N
Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.
is_test tinyint 3  √  0
is_pay_later tinyint 3  √  0
contribution_status_id int unsigned 10  √  1
address_id int unsigned 10  √  null
civicrm_address.id FK_civicrm_contribution_address_id N
Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.
check_number varchar 255  √  null
campaign_id int unsigned 10  √  null
civicrm_campaign.id FK_civicrm_contribution_campaign_id N
The campaign for which this contribution has been triggered.
creditnote_id varchar 255  √  null unique credit note id, system generated or passed in
tax_amount decimal 20,2  √  null Total tax amount of this contribution.

Table contained 93 rows at mer. avr. 13 16:52 EDT 2016

Indexes:
Column(s) Type Sort Constraint Name Anomalies
id Primary key Asc PRIMARY  
check_number Performance Asc check_number  
address_id Performance Asc FK_civicrm_contribution_address_id  
campaign_id Performance Asc FK_civicrm_contribution_campaign_id  
contact_id Performance Asc FK_civicrm_contribution_contact_id  
contribution_page_id Performance Asc FK_civicrm_contribution_contribution_page_id  
contribution_recur_id Performance Asc FK_civicrm_contribution_contribution_recur_id  
financial_type_id Performance Asc FK_civicrm_contribution_financial_type_id  
contribution_status_id Performance Asc index_contribution_status  
creditnote_id Performance Asc index_creditnote_id  
source Performance Asc index_source  
total_amount + receive_date Performance Asc/Asc index_total_amount_receive_date  
receive_date Performance Asc received_date  
invoice_id Must be unique Asc UI_contrib_invoice_id This unique column is also nullable
payment_instrument_id Performance Asc UI_contrib_payment_instrument_id  
trxn_id Must be unique Asc UI_contrib_trxn_id This unique column is also nullable

Close relationships  within of separation: