MySQL Workbench Synchronization: error in CREATE TABLE IF NOT EXISTS `mydb`.`timestamps` ( -
i'm new mysql. tried creating few tables in new schema using mysql workbench. attempted "synchronize model database" completed errors. reason mysql workbench auto generated sql includes create table if not exists mydb
.timestamps
..... appears problem. closest thing find of relevance in workbench's schema gui editor has pane on right called modeling actions had default template called timestamps. didn't use in simple test project.
i using mysql 5.7.16 win64. mysql workbench: 6.3.7 (build 1199ce)
i realize has null value being put non-null field but, how table/field being created in first place if isn't part of tables?
can please lead me in right direction? came access novice , system different. can't schema design synchronized mysql.
***************************************************************************** * mysql workbench auto-generated sql - being made during synchronize... ***************************************************************************** -- mysql workbench synchronization -- generated: 2016-11-08 06:30 -- model: new model -- version: 1.0 -- project: name of project -- author: turtle set @old_unique_checks=@@unique_checks, unique_checks=0; set @old_foreign_key_checks=@@foreign_key_checks, foreign_key_checks=0; set @old_sql_mode=@@sql_mode, sql_mode='traditional,allow_invalid_dates'; create table if not exists `mydb`.`timestamps` ( `create_time` null default current_timestamp, `update_time` null) engine = innodb default character set = utf8; create table if not exists `mydb`.`tblworklog` ( `username` varchar(50) not null, `tblusers_username` varchar(50) not null, primary key (`username`), index `fk_tblworklog_tblusers_idx` (`tblusers_username` asc), constraint `fk_tblworklog_tblusers` foreign key (`tblusers_username`) references `mydb`.`tblusers` (`username`) on delete no action on update no action) engine = innodb default character set = utf8; create table if not exists `mydb`.`tblusers` ( `username` varchar(50) not null, `fname` varchar(50) null default null, `mname` varchar(50) null default null, `lname` varchar(50) null default null, `tbluserscol` varchar(45) null default null, `email` varchar(255) null default null, `tblworklog_username` int(11) not null, primary key (`username`)) engine = innodb default character set = utf8; create table if not exists `mydb`.`tbljobcodes` ( `jobcode` varchar(50) not null, `shortname` varchar(100) null default null, `longname` varchar(255) null default null, `description` varchar(4000) null default null, primary key (`jobcode`)) engine = innodb default character set = utf8; create table if not exists `mydb`.`tblroles` ( `roleid` varchar(25) not null, `description` varchar(255) null default null, primary key (`roleid`)) engine = innodb default character set = utf8; set sql_mode=@old_sql_mode; set foreign_key_checks=@old_foreign_key_checks; set unique_checks=@old_unique_checks;
--
***************************************************************************** * error message mysql workbench ***************************************************************************** executing sql script in server error: error 1064: have error in sql syntax; check manual corresponds mysql server version right syntax use near 'null default current_timestamp, `update_time` null) engine = innodb default c' @ line 2 sql code: create table if not exists `mydb`.`timestamps` ( `create_time` null default current_timestamp, `update_time` null) engine = innodb default character set = utf8 sql script execution finished: statements: 3 succeeded, 1 failed fetching view definitions in final form. nothing fetch
try creating 1 table each time.
but belive problem using null
default
check examples
should be:
create table if not exists `mydb`.`timestamps` ( `create_time` default current_timestamp, `update_time`) engine = innodb default character set = utf8;
Comments
Post a Comment