Page 1 of 1

Field 'status' doesn't have a default value

Posted: Tue Feb 18, 2020 1:07 pm
by OCReactive
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: Field 'status' doesn't have a default value

Write your message below: When submiting a ticket from recetly updated to 3.0.0 HESK, it gaves me the error:

Error
Can't execute SQL: INSERT INTO `hesk_tickets` ( `trackid`, `name`, `email`, `category`, `priority`, `subject`, `message`, `dt`, `lastchange`, `articles`, `ip`, `language`, `openedby`, `owner`, `attachments`, `merged`, `history` , `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`, `custom11`, `custom12`, `custom13`, `custom14`, `custom15`, `custom16`, `custom17`, `custom18`, `custom19`, `custom20`, `custom21`, `custom22`, `custom23`, `custom24`, `custom25`, `custom26`, `custom27`, `custom28`, `custom29`, `custom30`, `custom31`, `custom32`, `custom33`, `custom34`, `custom35`, `custom36`, `custom37`, `custom38`, `custom39`, `custom40`, `custom41`, `custom42`, `custom43`, `custom44`, `custom45`, `custom46`, `custom47`, `custom48`, `custom49`, `custom50` ) VALUES ( 'M6Y-71A-BAMS', 'test', '', '2', '3', 'test', 'a', NOW(), NOW(), NULL, '192.168.219.85', NULL, '1', '0', '', '', '

2020-02-18 13:06:00 | ticket created by Óscar Cuesta (ocuesta)
' , 'Sin especificar', 'Larrabetzu Sarrikola', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' )
MySQL said:
Field 'status' doesn't have a default value

Re: Field 'status' doesn't have a default value

Posted: Tue Feb 18, 2020 1:19 pm
by mkoch227
Was this a straight upgrade from HESK 2.8.5, or was this a previous Mods for HESK installation?

Re: Field 'status' doesn't have a default value

Posted: Tue Feb 18, 2020 8:39 pm
by Klemen
HESK 3 doesn't make any changes to the database structure, so this must indeed be an old version or mods issue.

Runing the following in phpMyAdmin should fix this specific error:

Code: Select all

ALTER TABLE `hesk_tickets` CHANGE `status` `status` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
In any case please answer Mike's question so we can properly locate the issue and see how we can improve the update script.

Re: Field 'status' doesn't have a default value

Posted: Wed Feb 19, 2020 7:28 am
by OCReactive
mkoch227 wrote: Tue Feb 18, 2020 1:19 pm Was this a straight upgrade from HESK 2.8.5, or was this a previous Mods for HESK installation?
It was HESK 2.8.4 with MfH lastest (I skipped HESK 2.8.5, maybe it was a bad idea).
Klemen wrote: Tue Feb 18, 2020 8:39 pm Runing the following in phpMyAdmin should fix this specific error:

Code: Select all

ALTER TABLE `hesk_tickets` CHANGE `status` `status` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
It worked like a charm!
Thanks!

Re: Field 'status' doesn't have a default value

Posted: Fri Oct 16, 2020 10:06 pm
by esmith
I am going from Hesk 2.7.5 with MFH to hesk 312 and have the same sql error. When tyring to run the same script on my phpmyadmin I get this error.

#1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'closedat' at row 1889

Re: Field 'status' doesn't have a default value

Posted: Sat Oct 17, 2020 6:19 am
by Klemen
The original Hesk nevers sets closedat row dae to '0000-00-00 00:00:00' so it's something either MFH added or changed when uninstalling it.

You did ununstall MFH first, didn't you? Upgrading from MFH to Hesk 3 is not supported.

Manually running this query should fix the error you get, but there could be new ones:

Code: Select all

ALTER TABLE `hesk_tickets` CHANGE `closedat` `closedat` timestamp NULL DEFAULT NULL