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)
|
||||
|
||||
if c.Constraint != "" {
|
||||
// covers UNQ constraint with padding
|
||||
if c.Constraint == "primary_key_foreign_key" {
|
||||
// covers "PK FK" constraint with padding
|
||||
constraintWidth = 80
|
||||
} else if c.Constraint != "" && constraintWidth == 0 {
|
||||
// covers remaining constraints with "UNQ" being the largest
|
||||
constraintWidth = 60
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ func (c SQLColumn) ConstraintAbbr() string {
|
|||
return "PK"
|
||||
case "foreign_key":
|
||||
return "FK"
|
||||
case "primary_key_foreign_key":
|
||||
return "PK FK"
|
||||
case "unique":
|
||||
return "UNQ"
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue