Hi everyone,
I’m Minh from dbdiagram team, here to bring you some good news, dbdiagram now support two much request features: composite foreign key and import from SQL Server!
Composite Foreign Key
A composite foreign key is a foreign key that, much like composite primary key which we have already supported, consists of two or more columns.
Syntax
//Long form
Ref name_optional {
table1.(column1, column2,...) [<|>|-] table2.(columnA, columnB,...)
}
//Short form:
Ref name_optional: table1.(column1, column2,...) [<|>|-] table2.(columnA, columnB,...)
Example
Table user {
id int
country_code int
}
Table account {
user_id int
country_code int
}
Ref: user.(id, country_code) - account.(user_id, country_code)
Import from SQL Server
Just a few clicks to transform your SQL Server file into a nice diagram: