Default On Update value

Hello,
I’m running into issue when I want express this mysql script

CREATE TABLE t_member (
id int PRIMARY KEY,
name varchar(250) NOT NULL,
DATE_CREATION datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
DATE_MODIFICATION datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
)

My DBML is
Table t_member {
id int [pk]
name varchar(250) [not null]
DATE_CREATION datetime [NOT NULL, default: CURRENT_TIMESTAMP]
DATE_MODIFICATION datetime [default: NULL ON UPDATE CURRENT_TIMESTAMP]
}
and the result is
CREATE TABLE t_member (
id int PRIMARY KEY,
name varchar(250) NOT NULL,
DATE_CREATION datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
DATE_MODIFICATION datetime DEFAULT (NULL ON UPDATE CURRENT_TIMESTAMP)
);
which is not valid, I should not wrap the default value inside ()

Hi @zoraj, I’m Khoa from the dbdiagram team.
Currently, we haven’t supported ON UPDATE for mysql yet but we already have plans to support them all.
For now you can workaround by removing unsupported syntax.

1 Like

Hi @Khoa_Huynh
When do you expect to support the update syntax for mySQL ?
/J

1 Like