Dany
Dany

Reputation: 47

mysql forward engineering error

I am trying to build a data base and I get this exact error. Is there something wrong with this table?

ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(4) NOT NULL, PRIMARY KEY (seminarsID), INDEX fk_SEMINARS_ROOMS1_idx (`R' at line 10

SQL Code:

        -- Table `CSY2028_13433571`.`SEMINARS`
        -- -----------------------------------------------------
        CREATE TABLE IF NOT EXISTS `CSY2028_13433571`.`SEMINARS` (
          `seminarsID` INT NOT NULL AUTO_INCREMENT,
          `ROOMS_roomsID` INT NOT NULL,
          `seminarName` VARCHAR(200) NOT NULL,
          `seminarDescription` LONGTEXT NOT NULL,
          `date` DATE NOT NULL,
          `time` TIME(4) NOT NULL,
          PRIMARY KEY (`seminarsID`),
          INDEX `fk_SEMINARS_ROOMS1_idx` (`ROOMS_roomsID` ASC),
          CONSTRAINT `fk_SEMINARS_ROOMS1`
            FOREIGN KEY (`ROOMS_roomsID`)
            REFERENCES `CSY2028_13433571`.`ROOMS` (`roomsID`)
            ON DELETE NO ACTION
            ON UPDATE NO ACTION)
        ENGINE = InnoDB

SQL script execution finished: statements: 7 succeeded, 1 failed
Fetching back view definitions in final form.
Nothing to fetch

Upvotes: 0

Views: 739

Answers (1)

juergen d
juergen d

Reputation: 204894

TIME does not need a length information. So just use

TIME

instead of

TIME(4)

Upvotes: 2

Related Questions