CREATE TABLE avec 2 champs TIMESTAMP définit par defaut avec une clause ON UPDATE
Bonjour,
Je souhaiterait créer une table avec la requête suivante:
Code:
1 2 3 4 5 6 7 8 9 10 11
| DROP TABLE IF EXISTS `url`;
CREATE TABLE IF NOT EXISTS `url` (
`ID` int(10) unsigned NOT NULL auto_increment,
`ID_ci` int(10) unsigned NOT NULL,
`url` varchar(255) NOT NULL,
`muid` int(10) unsigned NOT NULL,
`mtime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`cuid` int(10) unsigned NOT NULL,
`ctime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='URL' AUTO_INCREMENT=1 ; |
Mais MySQL tilt, sur la deuxième déclaration TIMESTAMP DEFAULT CURRENT_TIMESTAMP; voici le message:
Citation:
#1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
Comment peut-on outrepasser cette limite?