Search code examples
mysqlsqlorbeon

error in creating mysql table


I get an error when i execute this script:

create table orbeon_form_definition_attach (
created            timestamp(6),
last_modified_time timestamp(6),
last_modified_by   varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
app                varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
form               varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
form_version       int not null,
deleted            char(1)                                   COLLATE utf8_bin        NOT     NULL,
file_name          varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
file_content       longblob
)   engine = InnoDB;

The error is : Error Code: 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 (6), last_modified_time timestamp(6), last_modified_by varchar(255) at line 2 0.000 sec

any idea how to solve this??


Solution

  • datetime or timestamp does not have a length

    create table orbeon_form_definition_attach 
    (
    created            datetime,
    last_modified_time datetime,
    last_modified_by   varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
    app                varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
    form               varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
    form_version       int not null,
    deleted            char(1)                                   COLLATE utf8_bin        NOT     NULL,
    file_name          varchar(255)           CHARACTER SET utf8 COLLATE utf8_bin,
    file_content       longblob
    )   engine = InnoDB;