Comment 2 for bug 1364457

Revision history for this message
Olaf van Zandwijk (olafz) wrote :

The table was actually empty at the time of the altering. The structure was as follows (slightly changed some names):

CREATE TABLE `tablename` (
  `objectid` bigint(20) NOT NULL AUTO_INCREMENT,
  `employeeobjectid` bigint(20) NOT NULL,
  `clusterobjectid` bigint(20) NOT NULL,
  `date` date NOT NULL,
  `durationclienttime` int(11) NOT NULL DEFAULT '0',
  `durationworked` int(11) NOT NULL DEFAULT '0',
  `durationcontractfixed` int(11) NOT NULL DEFAULT '0',
  `durationcontractvar` int(11) NOT NULL DEFAULT '0',
  `durationtimesheet` int(11) NOT NULL DEFAULT '0',
  `durationworkedorig` int(11) NOT NULL DEFAULT '0',
  `durationmodifiediome` int(11) NOT NULL DEFAULT '0',
  `counterrors` int(11) NOT NULL DEFAULT '0',
  `countunverified` int(11) NOT NULL DEFAULT '0',
  `durationtravel` int(11) NOT NULL DEFAULT '0',
  `durationsickleave` int(11) NOT NULL DEFAULT '0',
  `durationvacation` int(11) NOT NULL DEFAULT '0',
  `expenseday` int(11) NOT NULL DEFAULT '0',
  `expensedistance` int(11) NOT NULL DEFAULT '0',
  `durationPLBLeave` int(11) NOT NULL DEFAULT '0',
  `countunverifiedexpenses` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`objectid`),
  UNIQUE KEY `unique_tablename` (`employeeobjectid`,`date`),
  KEY `IX_tablename_clusterobjectid_date` (`clusterobjectid`,`date`),
  KEY `IX_tablename_date` (`date`),
  CONSTRAINT `tablename_ibfk_1` FOREIGN KEY (`employeeobjectid`) REFERENCES `...` (`objectid`) ON DELETE CASCADE,
  CONSTRAINT `tablename_ibfk_2` FOREIGN KEY (`clusterobjectid`) REFERENCES `...` (`objectid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1