Skip to content

sql2dbml - Mysql 8.0.13+ reference to column in DEFAULT generates incorrect dbml #687

@nerdwave-nick

Description

@nerdwave-nick

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions