Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Error after upgrade to 2.1.20 - Need Help

Mah Dia   ( User )

Commented 3 years ago

Hello,

I just update it to 2.1.20 and it stops at 60%.
Now, When I am adding a new invoice or customer getting the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'created_by' in 'field list' (SQL: insert into `xcv_documents` (`document_number`, `order_number`, `currency_rate`, `type`, `status`, `amount`, `notes`, `footer`, `currency_code`, `issued_at`, `due_at`, `category_id`, `contact_id`, `contact_name`, `contact_email`, `contact_tax_number`, `contact_phone`, `contact_address`, `company_id`, `created_by`, `updated_at`, `created_at`) .............

Kindly help!

Thanks

Jhay Pqb   ( User )

Commented 3 years ago

if you have a backup before the update, restore it.

Hans Vos   ( User )

Commented 3 years ago

I have the same issue, but did not had an error during the upgrade.

Web Treasurer   ( User )

Commented 3 years ago

Can anyone help on this - I am unable to do any work. No error in upgrades, but this SQL now with adding new transactions, customers, etc.

Web Treasurer   ( User )

Commented 3 years ago

My (ongoing) fix:
Each time I get one of these errors (somehow this new column is not getting created in the DB for some of us), I go into PhPMyAdmin:
1) Select my Akaunting DB
2) Select the table listed in the error (so far: contacts, reconciliations, transactions - but I'm sure lots of others will need it - we have very simple books)
3) go to STRUCTURE tab
4) below table is place to Add 1+ column(s) at/after, I leave default and click "Add" button
5) settings I needed were only Name (created_by), Type (INT), Length/Values (11), Default (As defined: 1)
6) Click "Save" - works immediately.

For those who have command-line access and MySQL access, the generated SQL syntax is reported by PhPMyAdmin as:

ALTER TABLE `ak7e_reconciliations` ADD `created_by` INT(11) NOT NULL DEFAULT '1' AFTER `deleted_at`;

Hope this helps someone.

Rajesh   ( User )

Commented 3 years ago

I had same issue after update to 2.1.22, reason is the db migration of 17/05 and 17/06 is not successful.
to fix, execute following sql if you have access
ALTER TABLE nho_media ADD COLUMN company_id int(10) unsigned default 0 after id;
ALTER TABLE nho_mediables ADD COLUMN company_id int(10) unsigned default 0 after media_id;
ALTER TABLE nho_accounts ADD COLUMN created_by int(10) unsigned default null after enabled;
ALTER TABLE nho_categories ADD COLUMN created_by int(10) unsigned default null after enabled;
ALTER TABLE nho_companies ADD COLUMN created_by int(10) unsigned default null after enabled;
ALTER TABLE nho_contacts ADD COLUMN created_by int(10) unsigned default null after reference;
ALTER TABLE nho_currencies ADD COLUMN created_by int(10) unsigned default null after enabled;
ALTER TABLE nho_dashboards ADD COLUMN created_by int(10) unsigned default null after enabled;
ALTER TABLE nho_documents ADD COLUMN created_by int(10) unsigned default null after parent_id;
ALTER TABLE nho_items ADD COLUMN created_by int(10) unsigned default null after enabled;
ALTER TABLE nho_reconciliations ADD COLUMN created_by int(10) unsigned default null after reconciled;
ALTER TABLE nho_reports ADD COLUMN created_by int(10) unsigned default null after settings;
ALTER TABLE nho_taxes ADD COLUMN created_by int(10) unsigned default null after enabled;
ALTER TABLE nho_transactions ADD COLUMN created_by int(10) unsigned default null after parent_id;
ALTER TABLE nho_transfers ADD COLUMN created_by int(10) unsigned default null after income_transaction_id;
ALTER TABLE nho_widgets ADD COLUMN created_by int(10) unsigned default null after settings;

Rajesh   ( User )

Commented 3 years ago

change those nho_ table prefix to whatever you may for your tables...

Please login or register to leave a response.

Showing 1 to 7 of 7 discussions