dbml
dbml copied to clipboard
sql2dbml - Mysql 8.0.13+ reference to column in DEFAULT generates incorrect dbml
I ran into the issue that for sql statements like the following
CREATE TABLE `some_table` (
code VARCHAR(6)
);
-- migration file later on
UPDATE TABLE `some_table`
ADD name VARCHAR(80) DEFAULT(`code`);
generates incorrect dbml when generated from an sql dump. The resulting dbml will have double backticks around the word code, as follows:
name VARCHAR(80) DEFAULT(``code``)
This leads to tools following in the pipeline to error.
Hi @nerdwave-nick ,
Could you help send us the correct version of your DDL statements? Since the provided has a syntax error in MySQL 8.0.
Also, can you help explain what the purpose of the name column is? Is it default value be the value of the code column?