Here are the changes between 4.0.4 tarball and civiaccounts as at July 1, with a few unrelated changes removed:
CREATE TABLE civicrm_credit_adjustment (
id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Credit Adjustment ID' auto_increment,
contact_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to Contact ID',
contact_snapshot text NULL DEFAULT NULL COMMENT 'Note and/or Comment.' COLLATE utf8_unicode_ci,
address_id int(10) unsigned NULL DEFAULT NULL COMMENT 'Conditional foreign key to civicrm_address.id. We insert an address record for each adjustment when we have associated billing name and address data.',
adjustment_date datetime NULL DEFAULT NULL COMMENT 'When adjustment to order was created',
adjustment_reason text NULL DEFAULT NULL COMMENT '' COLLATE utf8_unicode_ci,
communication_date datetime NULL DEFAULT NULL COMMENT 'when letter or email notifying payor of adjustment sent',
adjustment_status_id int(10) unsigned NULL DEFAULT '1' COMMENT '',
msg_template_id int(10) unsigned NULL DEFAULT NULL COMMENT 'template used to generate adjustment',
PRIMARY KEY (id),
INDEX adjustment_date (adjustment_date),
INDEX index_adjustment_status (adjustment_status_id),
INDEX FK_civicrm_credit_adjustment_contact_id (contact_id),
INDEX FK_civicrm_credit_adjustment_address_id (address_id),
INDEX FK_civicrm_credit_adjustment_msg_template_id (msg_template_id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE civicrm_official_receipt (
id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Receipt ID' auto_increment,
contact_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to Contact ID',
contact_snapshot text NULL DEFAULT NULL COMMENT 'Serialized array of contact info of payor at time receipt is created' COLLATE utf8_unicode_ci,
issued_date datetime NOT NULL DEFAULT 0000-00-00 00:00:00 COMMENT '',
start_date datetime NOT NULL DEFAULT 0000-00-00 00:00:00 COMMENT '',
end_date datetime NOT NULL DEFAULT 0000-00-00 00:00:00 COMMENT '',
receipt_status_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'pseudo FK to civicrm_option_value',
receipt_type_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'pseudo FK to civicrm_option_value',
total_amount decimal(20,2) NOT NULL DEFAULT '' COMMENT 'Total amount for this receipt.',
non_deductible_amount decimal(20,2) NULL DEFAULT NULL COMMENT 'Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible contribution types.',
currency varchar(3) NULL DEFAULT NULL COMMENT '3 character string, value from config setting or input via user.' COLLATE utf8_unicode_ci,
msg_template_id int(10) unsigned NULL DEFAULT NULL COMMENT 'template used to generate receipt',
PRIMARY KEY (id),
INDEX UI_issued_date (issued_date),
INDEX UI_start_date (start_date),
INDEX UI_end_date (end_date),
INDEX UI_receipt_status_id (receipt_status_id),
INDEX UI_receipt_type_id (receipt_type_id),
INDEX FK_civicrm_official_receipt_contact_id (contact_id),
INDEX FK_civicrm_official_receipt_msg_template_id (msg_template_id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE civicrm_order (
id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Order ID' auto_increment,
contact_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to Contact ID',
contact_snapshot text NULL DEFAULT NULL COMMENT 'Note and/or Comment.' COLLATE utf8_unicode_ci,
address_id int(10) unsigned NULL DEFAULT NULL COMMENT 'Conditional foreign key to civicrm_address.id. We insert an address record for each order when we have associated billing name and address data.',
order_date datetime NULL DEFAULT NULL COMMENT 'When order was created',
non_deductible_amount decimal(20,2) NULL DEFAULT '0.00' COMMENT 'Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial_accounts.',
non_deductible_financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account',
total_amount decimal(20,2) NOT NULL DEFAULT '' COMMENT 'Total amount of this order. Use market value for non-monetary gifts.',
financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account',
tax_total decimal(20,2) NOT NULL DEFAULT '' COMMENT '',
tax_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account.',
invoice_id varchar(255) NULL DEFAULT NULL COMMENT 'Unique invoice id passed in' COLLATE utf8_unicode_ci,
currency varchar(3) NULL DEFAULT NULL COMMENT '3 character string, value from config setting or input via user.' COLLATE utf8_unicode_ci,
thankyou_date datetime NULL DEFAULT NULL COMMENT 'when (if) payor was thanked',
source varchar(255) NULL DEFAULT NULL COMMENT 'Origin of this Order.' COLLATE utf8_unicode_ci,
is_test tinyint(4) NULL DEFAULT '0' COMMENT 'Is this a test order?',
is_pay_later tinyint(4) NULL DEFAULT '0' COMMENT 'Is this order to be paid later than when it is created?',
order_status_id int(10) unsigned NULL DEFAULT '1' COMMENT '',
add_credit_adjustment_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to civicrm_credit_adjustment',
delete_credit_adjustment_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to civicrm_credit_adjustment',
msg_template_id int(10) unsigned NULL DEFAULT NULL COMMENT 'template used to generate order',
campaign_id int(10) unsigned NULL DEFAULT NULL COMMENT 'The campaign for which this contribution has been triggered.',
PRIMARY KEY (id),
UNIQUE invoice_id (invoice_id),
INDEX order_date (order_date),
INDEX index_order_status (order_status_id),
INDEX FK_civicrm_order_contact_id (contact_id),
INDEX FK_civicrm_order_address_id (address_id),
INDEX FK_civicrm_order_non_deductible_financial_account_id (non_deductible_financial_account_id),
INDEX FK_civicrm_order_financial_account_id (financial_account_id),
INDEX FK_civicrm_order_tax_account_id (tax_account_id),
INDEX FK_civicrm_order_add_credit_adjustment_id (add_credit_adjustment_id),
INDEX FK_civicrm_order_delete_credit_adjustment_id (delete_credit_adjustment_id),
INDEX FK_civicrm_order_msg_template_id (msg_template_id),
INDEX FK_civicrm_order_campaign_id (campaign_id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE civicrm_order_line_item (
id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Order Line Item ID' auto_increment,
order_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to Order ID',
total_amount decimal(20,2) NOT NULL DEFAULT '' COMMENT 'Total amount of this order_line_item. Use market value for non-monetary amounts.',
financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account. NB: Financial Account for (total_amount - non_deductible_amount), NOT total_amount',
non_deductible_amount decimal(20,2) NULL DEFAULT '0.00' COMMENT 'Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial accounts.',
non_deductible_financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account',
tax_total decimal(20,2) NOT NULL DEFAULT '' COMMENT '',
tax_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account.',
source varchar(255) NULL DEFAULT NULL COMMENT 'Origin of this Line Item.' COLLATE utf8_unicode_ci,
contribution_page_id int(10) unsigned NULL DEFAULT NULL COMMENT 'The Contribution Page which triggered this line item.',
contribution_recur_id int(10) unsigned NULL DEFAULT NULL COMMENT '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(4) NULL DEFAULT '0' COMMENT '',
is_pay_later tinyint(4) NULL DEFAULT '0' COMMENT '',
campaign_id int(10) unsigned NULL DEFAULT NULL COMMENT 'The campaign from which this line item has been triggered.',
order_line_item_status_id int(10) unsigned NULL DEFAULT '1' COMMENT '',
add_credit_adjustment_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to civicrm_credit_adjustment',
delete_credit_adjustment_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to civicrm_credit_adjustment',
entity_table varchar(64) NOT NULL DEFAULT '' COMMENT 'civicrm_contribution, civicrm_participant, or civicrm_membership' COLLATE utf8_unicode_ci,
entity_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY (id),
INDEX index_order_line_item_status (order_line_item_status_id),
INDEX FK_civicrm_order_line_item_order_id (order_id),
INDEX FK_civicrm_order_line_item_financial_account_id (financial_account_id),
INDEX FK_civicrm_order_line_item_non_deductible_financial_account_id (non_deductible_financial_account_id),
INDEX FK_civicrm_order_line_item_tax_account_id (tax_account_id),
INDEX FK_civicrm_order_line_item_contribution_page_id (contribution_page_id),
INDEX FK_civicrm_order_line_item_contribution_recur_id (contribution_recur_id),
INDEX FK_civicrm_order_line_item_campaign_id (campaign_id),
INDEX FK_civicrm_order_line_item_add_credit_adjustment_id (add_credit_adjustment_id),
INDEX FK_civicrm_order_line_item_delete_credit_adjustment_id (delete_credit_adjustment_id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE civicrm_order_line_sub_item (
id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Order Line Sub Item' auto_increment,
order_line_item_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to order_line_item',
price_field_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to price_field',
label varchar(255) NOT NULL DEFAULT '' COMMENT 'descriptive label for item - from custom_option.label' COLLATE utf8_unicode_ci,
qty int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'How many items ordered',
unit_price decimal(20,2) NOT NULL DEFAULT '' COMMENT 'price of each item',
line_sub_total decimal(20,2) NOT NULL DEFAULT '' COMMENT 'qty * unit_price',
financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account. NB: Account for (line_total - non_deductible_line_total), NOT line_total',
non_deductible_unit_price decimal(20,2) NOT NULL DEFAULT '' COMMENT 'non deductible price of each item',
non_deductible_line_total decimal(20,2) NOT NULL DEFAULT '' COMMENT 'qty * non_deductible_unit_price',
non_deductible_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Account. NB: Financial Account for (line_total - non_deductible_line_total), NOT line_total',
tax_total decimal(20,2) NOT NULL DEFAULT '' COMMENT '',
tax_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account.',
participant_count int(10) unsigned NULL DEFAULT NULL COMMENT 'Participant count for line sub item',
price_field_value_id int(10) unsigned NULL DEFAULT NULL COMMENT 'Implicit FK to civicrm_option_value',
order_status_id int(10) unsigned NULL DEFAULT '1' COMMENT '',
add_credit_adjustment_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to civicrm_credit_adjustment',
delete_credit_adjustment_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to civicrm_credit_adjustment',
PRIMARY KEY (id),
UNIQUE UI_line_sub_item_value (order_line_item_id, price_field_value_id, price_field_id),
INDEX index_order_status (order_status_id),
INDEX FK_civicrm_order_line_sub_item_price_field_id (price_field_id),
INDEX FK_civicrm_order_line_sub_item_financial_account_id (financial_account_id),
INDEX FK_civicrm_order_line_sub_item_non_deductible_account_id (non_deductible_account_id),
INDEX FK_civicrm_order_line_sub_item_tax_account_id (tax_account_id),
INDEX FK_civicrm_order_line_sub_item_price_field_value_id (price_field_value_id),
INDEX FK_civicrm_order_line_sub_item_add_credit_adjustment_id (add_credit_adjustment_id),
INDEX FK_civicrm_order_line_sub_item_delete_credit_adjustment_id (delete_credit_adjustment_id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE civicrm_batch
ADD saved_search_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Saved Search ID' AFTER modified_date,
ADD INDEX FK_civicrm_batch_saved_search_id (saved_search_id);
ALTER TABLE civicrm_contribution
ADD contact_snapshot text NULL DEFAULT NULL COMMENT 'Serialized array of contact info of payor at time invoice is created' COLLATE utf8_unicode_ci AFTER contact_id,
ADD financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account for (total_amount - non_deductible_amount).' AFTER contact_snapshot,
ADD non_deductible_financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account' AFTER non_deductible_amount,
ADD payment_status_id int(10) unsigned NULL DEFAULT '1' COMMENT '' AFTER honor_contact_id,
DROP contribution_type_id,
DROP payment_instrument_id,
DROP receive_date,
DROP fee_amount,
DROP net_amount,
DROP trxn_id,
DROP invoice_id,
DROP currency,
DROP cancel_date,
DROP cancel_reason,
DROP receipt_date,
DROP thankyou_date,
DROP contribution_recur_id,
DROP is_test,
DROP is_pay_later,
DROP contribution_status_id,
DROP address_id,
DROP check_number,
DROP INDEX UI_contrib_trxn_id,
DROP INDEX UI_contrib_invoice_id,
DROP INDEX UI_contrib_payment_instrument_id,
DROP INDEX index_contribution_status,
DROP INDEX received_date,
DROP INDEX check_number,
DROP INDEX FK_civicrm_contribution_contribution_type_id,
DROP INDEX FK_civicrm_contribution_contribution_recur_id,
DROP INDEX FK_civicrm_contribution_address_id,
ADD INDEX FK_civicrm_contribution_financial_account_id (financial_account_id),
ADD INDEX FK_civicrm_contribution_non_deductible_financial_account_id (non_deductible_financial_account_id);
ALTER TABLE civicrm_contribution_page
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'default financial account assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution' AFTER intro_text,
ADD non_deductible_financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account' AFTER financial_account_id,
DROP contribution_type_id,
DROP INDEX FK_civicrm_contribution_page_contribution_type_id,
ADD INDEX FK_civicrm_contribution_page_financial_account_id (financial_account_id),
ADD INDEX FK_civicrm_contribution_page_non_deductible_financial_account_id (non_deductible_financial_account_id);
ALTER TABLE civicrm_contribution_product
ADD total_cost decimal(20,2) NOT NULL DEFAULT '' COMMENT 'quantity X civicrm_product.cost.' AFTER quantity,
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Financial account assigned to total_cost.' AFTER total_cost,
ADD INDEX FK_civicrm_contribution_product_financial_account_id (financial_account_id);
ALTER TABLE civicrm_contribution_recur
ADD financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account. NB: Financial Account for (amount - non_deductible_amount), NOT amount' AFTER amount,
ADD non_deductible_amount decimal(20,2) NULL DEFAULT '0.00' COMMENT 'Portion of amount which is NOT tax deductible. Equal to amount for non-deductible contribution types.' AFTER financial_account_id,
ADD non_deductible_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account' AFTER non_deductible_amount,
ADD INDEX FK_civicrm_contribution_recur_financial_account_id (financial_account_id),
ADD INDEX FK_civicrm_contribution_recur_non_deductible_account_id (non_deductible_account_id);
DROP TABLE civicrm_contribution_type;
ALTER TABLE civicrm_entity_financial_trxn
MODIFY entity_table varchar(64) NOT NULL DEFAULT '' COMMENT 'May contain civicrm_order, civicrm_order_line_itme, civicrm_order_line_sub_item, civicrm_grant, civicrm_credit_adjustment' COLLATE utf8_unicode_ci;
ALTER TABLE civicrm_event
ADD financial_account_id int(10) unsigned NULL DEFAULT '0' COMMENT 'Financial account assigned to paid event registrations for this event. Required if is_monetary is true.' AFTER is_monetary,
DROP contribution_type_id;
ALTER TABLE civicrm_financial_account
ADD contact_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Contact ID' AFTER name,
ADD financial_account_type_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'pseudo FK into civicrm_option_value.' AFTER contact_id,
ADD accounting_code varchar(64) NULL DEFAULT NULL COMMENT 'Optional value for mapping monies owed and received to accounting system codes.' COLLATE utf8_unicode_ci AFTER financial_account_type_id,
ADD parent_id int(10) unsigned NULL DEFAULT NULL COMMENT 'Parent ID in account hierarchy' AFTER accounting_code,
ADD is_header_account tinyint(4) NULL DEFAULT NULL COMMENT 'Is this a header account which does not allow transactions to be posted against it directly, but only to its sub-accounts?' AFTER parent_id,
ADD is_deductible tinyint(4) NULL DEFAULT '1' COMMENT 'Is this account tax-deductible?' AFTER is_header_account,
ADD is_reserved tinyint(4) NULL DEFAULT NULL COMMENT 'Is this a predefined system object?' AFTER is_deductible,
ADD is_active tinyint(4) NULL DEFAULT NULL COMMENT 'Is this property active?' AFTER is_reserved,
ADD is_default tinyint(4) NULL DEFAULT NULL COMMENT 'Is this account the default one (or default tax one) for its financial_account_type?' AFTER is_active,
MODIFY name varchar(255) NOT NULL DEFAULT '' COMMENT 'Financial Account Name.' COLLATE utf8_unicode_ci,
DROP account_type_id,
ADD UNIQUE UI_name (name),
ADD INDEX FK_civicrm_financial_account_contact_id (contact_id),
ADD INDEX FK_civicrm_financial_account_parent_id (parent_id);
#Fieldformat of civicrm_financial_account.name changed from varchar(255) NOT NULL DEFAULT '' COMMENT '' COLLATE utf8_unicode_ci to varchar(255) NOT NULL DEFAULT '' COMMENT 'Financial Account Name.' COLLATE utf8_unicode_ci.Possibly data modifications needed!
#
ALTER TABLE civicrm_financial_trxn
ADD to_financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to financial_financial_account table.' AFTER id,
ADD fee_currency varchar(3) NULL DEFAULT NULL COMMENT '3 character string, value from config setting or input via user.' COLLATE utf8_unicode_ci AFTER fee_amount,
ADD payment_instrument_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Payment Instrument' AFTER trxn_result_code,
ADD check_number varchar(255) NULL DEFAULT NULL COMMENT '' COLLATE utf8_unicode_ci AFTER payment_instrument_id,
ADD cancel_date datetime NULL DEFAULT NULL COMMENT 'when financial transaction failed' AFTER check_number,
ADD cancel_reason text NULL DEFAULT NULL COMMENT 'why financial transaction failed' COLLATE utf8_unicode_ci AFTER cancel_date,
ADD financial_trxn_status_id int(10) unsigned NULL DEFAULT NULL COMMENT '' AFTER cancel_reason,
ADD contact_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to Contact ID' AFTER financial_trxn_status_id,
ADD contact_snapshot text NULL DEFAULT NULL COMMENT 'Serialized array of contact info of payor at time receipt is created' COLLATE utf8_unicode_ci AFTER contact_id,
DROP from_account_id,
DROP to_account_id,
DROP INDEX FK_civicrm_financial_trxn_from_account_id,
DROP INDEX FK_civicrm_financial_trxn_to_account_id,
ADD INDEX UI_contrib_payment_instrument_id (payment_instrument_id),
ADD INDEX check_number (check_number),
ADD INDEX FK_civicrm_financial_trxn_to_financial_account_id (to_financial_account_id),
ADD INDEX FK_civicrm_financial_trxn_contact_id (contact_id);
ALTER TABLE civicrm_grant
ADD financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to civicrm_financial_account.' AFTER amount_granted,
MODIFY currency varchar(3) NOT NULL DEFAULT '' COMMENT '3 character string, value from config setting or input via user.' COLLATE utf8_unicode_ci,
ADD INDEX FK_civicrm_grant_financial_account_id (financial_account_id);
#
- Fieldformat of
- civicrm_grant.currency changed from varchar(8) NULL DEFAULT NULL COMMENT '3 character string, value from config setting or input via user.' COLLATE utf8_unicode_ci to varchar(3) NOT NULL DEFAULT '' COMMENT '3 character string, value from config setting or input via user.' COLLATE utf8_unicode_ci.
- Possibly data modifications needed!
#
DROP TABLE civicrm_line_item;
ALTER TABLE civicrm_membership
ADD financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account. NB: Account for (total_amount - non_deductible_amount), NOT total_amount' AFTER end_date,
ADD non_deductible_financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Account' AFTER financial_account_id,
ADD payor_snapshot text NULL DEFAULT NULL COMMENT 'Serialized array of contact info fields stored at time of membership purchase or renewal' COLLATE utf8_unicode_ci AFTER owner_membership_id,
ADD INDEX FK_civicrm_membership_financial_account_id (financial_account_id),
ADD INDEX FK_civicrm_membership_non_deductible_financial_account_id (non_deductible_financial_account_id);
ALTER TABLE civicrm_membership_type
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'If membership is paid by a contribution - what financial account should be used. FK to civicrm_financial_account.id' AFTER member_of_contact_id,
ADD non_deductible_amount decimal(20,2) NULL DEFAULT '0.00' COMMENT 'Non-deductible value of this membership type (0 for free/complimentary membership types).' AFTER minimum_fee,
DROP contribution_type_id,
DROP INDEX FK_civicrm_membership_type_contribution_type_id,
ADD INDEX FK_civicrm_membership_type_financial_account_id (financial_account_id);
ALTER TABLE civicrm_participant
ADD total_amount decimal(20,2) NOT NULL DEFAULT '' COMMENT 'Total amount for this participant.' AFTER is_pay_later,
ADD financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account for (total_amount - non_deductible_amount).' AFTER total_amount,
ADD non_deductible_amount decimal(20,2) NULL DEFAULT '0.00' COMMENT 'Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible contribution types.' AFTER financial_account_id,
ADD non_deductible_financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account' AFTER non_deductible_amount,
DROP fee_amount,
DROP fee_currency,
ADD INDEX FK_civicrm_participant_financial_account_id (financial_account_id),
ADD INDEX FK_civicrm_participant_non_deductible_financial_account_id (non_deductible_financial_account_id);
ALTER TABLE civicrm_payment_processor
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Financial account representing the account that the payment processor deposits into.' AFTER payment_type,
ADD INDEX FK_civicrm_payment_processor_financial_account_id (financial_account_id);
ALTER TABLE civicrm_pledge
ADD financial_account_id int(10) unsigned NULL DEFAULT NULL COMMENT 'FK to Financial Account' AFTER contact_id,
DROP contribution_type_id,
DROP INDEX FK_civicrm_pledge_contribution_type_id,
ADD INDEX FK_civicrm_pledge_financial_account_id (financial_account_id);
ALTER TABLE civicrm_premiums
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to civicrm_financial_account' AFTER premiums_display_min_contribution,
ADD INDEX FK_civicrm_premiums_financial_account_id (financial_account_id);
ALTER TABLE civicrm_premiums_product
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to civicrm_financial_account' AFTER product_id,
ADD INDEX FK_civicrm_premiums_product_financial_account_id (financial_account_id);
ALTER TABLE civicrm_price_field
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to financial_civicrm_account' AFTER price_set_id,
ADD INDEX FK_civicrm_price_field_financial_account_id (financial_account_id);
ALTER TABLE civicrm_price_field_value
ADD financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to financial_civicrm_account' AFTER price_field_id,
ADD non_deductible_amount varchar(512) NOT NULL DEFAULT '' COMMENT 'Price field option non-deductible amount' COLLATE utf8_unicode_ci AFTER amount,
ADD non_deductible_financial_account_id int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to civicrm_financial_account' AFTER non_deductible_amount,
ADD INDEX FK_civicrm_price_field_value_financial_account_id (financial_account_id),
ADD INDEX FK_civicrm_price_field_value_non_deductible_financial_account_id (non_deductible_financial_account_id);
