When inserting a new IT Service time definition using a mysql db, the code does not insert a timeid, and timeid defaults to 0; since it is a primary key, we need to either auto increment. Here's the correct alter table and create table statements:
and:
Code:
ALTER TABLE services_times MODIFY timeid bigint(20) unsigned NOT NULL AUTO_INCREMENT;
Code:
CREATE TABLE `services_times` ( `timeid` bigint(20) unsigned NOT NULL auto_increment, `serviceid` bigint(20) unsigned NOT NULL default '0', `type` int(11) NOT NULL default '0', `ts_from` int(11) NOT NULL default '0', `ts_to` int(11) NOT NULL default '0', `note` varchar(255) NOT NULL default '', PRIMARY KEY (`timeid`), KEY `services_times_times_1` (`serviceid`,`type`,`ts_from`,`ts_to`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1
Thanks anyway for reporting this! Fixed!
Comment