Re: Error loading script from workbench with TIMESTAMP default value
I'm using MySQL 5.0.45 and have cut down the SQL to remove the foreign keys to make...
CREATE TABLE IF NOT EXISTS `inventory` (
`tag_id` VARBINARY(48) NOT NULL ,
`ITEM_ID` INT(11) NOT NULL COMMENT 'Identificador unico del elemento del Cliente' ,
`ZONE_ID` INT(11) NOT NULL COMMENT 'Codigo de identificacion de zona' ,
`LEVEL_ID` INT(11) NOT NULL ,
`TAG_TS` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ,
`TS` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY (`tag_id`) ,
UNIQUE INDEX ITEM_ID (`ITEM_ID` ASC) ,
INDEX Inventory_Zone_FK (`ZONE_ID` ASC) ,
INDEX Inventory_SecurityLevel_FK (`LEVEL_ID` ASC))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1
COMMENT = 'Listado de elementos registrados en el sistema relacionados ';
and the table is created correctly.
I can also insert records...
+--------+---------+---------+----------+---------------------+---------------------+
| tag_id | ITEM_ID | ZONE_ID | LEVEL_ID | TAG_TS | TS |
+--------+---------+---------+----------+---------------------+---------------------+
| 1 | 1 | 1 | 1 | 2008-09-11 13:15:23 | 2008-09-11 13:15:23 |
| 2 | 2 | 1 | 1 | 0000-00-00 00:00:00 | 2008-09-11 13:17:59 |
+--------+---------+---------+----------+---------------------+---------------------+
Subject
Views
Written By
Posted
6220
September 05, 2008 06:29AM
Re: Error loading script from workbench with TIMESTAMP default value
3056
September 11, 2008 06:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.