d2
d2 copied to clipboard
[FR] sql_table: Support PK and FK composed by 2+ attributes
At the moment d2 can't represent FK
s that are composed of more than one column.
Example:
tenant: {
shape: sql_table
id: int {constraint: primary_key}
}
project: {
shape: sql_table
id: int
tenant: int {constraint: foreign_key}
# here i may want to have the PK defined as (id, tenant)
}
tenant.id <- project.tenant