lordfritte
Lieutenant
- Registriert
- Juli 2006
- Beiträge
- 967
Hallo, ich möchte eine Tabelle in einer Mysql Datenbank erzeugen und möchte wissen wie ich für eine Feld vom Typ TIMESTAMP die aktuelle Zeit und das Datum als default value festlegen kann.
Mein Statement:
Das Problem, MySQL meldet: #1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
Mein Statement:
Code:
CREATE TABLE IF NOT EXISTS `Konten` (
`idKonto` INT NOT NULL AUTO_INCREMENT ,
`typ` INT NOT NULL DEFAULT 1 ,
`name` VARCHAR(45) NOT NULL ,
`startWert` DOUBLE NOT NULL DEFAULT 0.0 ,
`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`changed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`isDeleted` TINYINT(1) NOT NULL DEFAULT false ,
PRIMARY KEY (`idKonto`) ,
UNIQUE INDEX `name_UNIQUE` (`name` ASC) )
ENGINE = InnoDB
Das Problem, MySQL meldet: #1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause