add "PK FK" constraint to sql_table
This commit is contained in:
parent
acba0733db
commit
dc14418ace
2 changed files with 7 additions and 2 deletions
|
|
@ -1024,8 +1024,11 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R
|
||||||
}
|
}
|
||||||
maxTypeWidth = go2.Max(maxTypeWidth, typeDims.Width)
|
maxTypeWidth = go2.Max(maxTypeWidth, typeDims.Width)
|
||||||
|
|
||||||
if c.Constraint != "" {
|
if c.Constraint == "primary_key_foreign_key" {
|
||||||
// covers UNQ constraint with padding
|
// covers "PK FK" constraint with padding
|
||||||
|
constraintWidth = 80
|
||||||
|
} else if c.Constraint != "" && constraintWidth == 0 {
|
||||||
|
// covers remaining constraints with "UNQ" being the largest
|
||||||
constraintWidth = 60
|
constraintWidth = 60
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ func (c SQLColumn) ConstraintAbbr() string {
|
||||||
return "PK"
|
return "PK"
|
||||||
case "foreign_key":
|
case "foreign_key":
|
||||||
return "FK"
|
return "FK"
|
||||||
|
case "primary_key_foreign_key":
|
||||||
|
return "PK FK"
|
||||||
case "unique":
|
case "unique":
|
||||||
return "UNQ"
|
return "UNQ"
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue