I've upgraded CiviCRM multiple times since we last ran an event which requires payments, and are now at 4.7.17 on Joomla 3.6.5 with MySQL 5.7.18.
When many (not all) users try to register they encounter "DBError: no such field" and the debug info points to Unknown column 'card_type' in 'field list', 1054
and the query
INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , status_id , payment_instrument_id ) VALUES ( 10 , 20170607160037 , 3200 , 0 , 3200 , 'SEK' , 2 , 4 ) [nativecode=1054 ** Unknown column 'card_type' in 'field list']
and the backtrace shows this
...
#14 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(487): DB_DataObject->insert()
#15 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/FinancialTrxn.php(66): CRM_Core_DAO->save()
#16 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution.php(3364): CRM_Core_BAO_FinancialTrxn::create((Array:11))
#17 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution.php(236): CRM_Contribute_BAO_Contribution::recordFinancialAccounts((Array:22))
#18 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php(1038): CRM_Contribute_BAO_Contribution::add((Array:22), (Array:0))
#19 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php(611): CRM_Event_Form_Registration_Confirm::processContribution(Object(CRM_Event_Form_Registration_Confirm), (Array:35), NULL, "6642", TRUE, FALSE, (Array:10))
#20 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php(453): CRM_Event_Form_Registration_Confirm->postProcess()
...
However, in my database the field does actually exist, as shown by this create statement generated from the table
CREATE TABLE `civicrm_financial_trxn` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Gift ID',
...
`card_type` int(10) unsigned DEFAULT NULL COMMENT 'FK to accept_creditcard option group values',
...
How can this happen? What do I do next? Should I try re-running the database upgrade script?