This repository was archived by the owner on Jan 28, 2021. It is now read-only.
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
Not support types of char and datetime #807
Closed
Description
It is always failed when there is type char
or type datetime
in the sql of creating table.
time="2019-08-20T20:12:33+08:00" level=error msg="Error parsing auth server config: unexpected end of JSON input"
time="2019-08-20T20:12:33+08:00" level=info msg="log: Error 1105: unknown error: Type not supported: CHAR\n"
conn, _ := sqlx.Open("mysql", "root:dev@(127.0.0.1:3306)/mydb")
_, err := conn.Exec(sql)
if err != nil {
log.Fatal(err)
}
sql:
CREATE TABLE `mytable` (
`id` char(36) NOT NULL,
`title` varchar(255) NOT NULL COMMENT '',
`export_id` varchar(36) NOT NULL COMMENT ' id',
`description` varchar(1024) DEFAULT NULL,
`source_project` varchar(255) NOT NULL COMMENT '',
`source_url` text NOT NULL COMMENT '',
`dest_projects` text NOT NULL COMMENT '',
`failed_projects` text COMMENT '',
`is_all_projects` int DEFAULT '0' COMMENT '',
`is_deleted` int NOT NULL DEFAULT '0' COMMENT '',
`status` varchar(10) COMMENT '',
`result` text COMMENT '',
`completed_on` datetime DEFAULT NULL COMMENT '',
`created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`created_by` varchar(36) DEFAULT NULL COMMENT 'Id',
`modified_on` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`modified_by` varchar(36) DEFAULT NULL COMMENT 'Id',
`distribute_type` int DEFAULT '0' COMMENT ' '
)