Ability to name a Foreign Key and a constraint in DBML

You provide the ability to name indices. It would be great to add the ability to provide a name for a Foreign key or a constraint.

ex:
"TicketCustomFieldId" int [ref: > zendesk.tbl_TicketCustomField.Id, not null]
would like to be able to name this FK_tbl_TicketCustomFieldOverride+TicketCustomFieldId-tbl_TicketCustomField+Id

Same would be true for constraints. This is less straight-forward as a column can have multiple constraints. I prefer specifying constraints and references in line with the column as you can see in my example above.

Hi @steven.perry,

Currently, you can name the foreign keys using the following syntax:

// Long form
Ref name_optional {
  schema1.table1.column1 < schema2.table2.column2
}

// Short form:
Ref name_optional: schema1.table1.column1 < schema2.table2.column2

However, the names won’t be shown on the diagram at the moment.

For naming other constraints, we have taken note of the suggestion and will look into it in the future.

Best regards,
Tho Nguyen.

I tried the short form:

...

 "TypeId" int [ref FK_tbl_Ticket.TypeId_tbl_Lookup.Id: > slgreen.tbl_Lookup.Id, not null, Note: '**Source** | `Z.ticket.type`; **Add\'l** | Returns this as a string. Convert to a lookup and store the Id.']
...

It gives two errors: Expected an identifier and Unknown column setting 'ref fk_tbl_ticket'.

Hi @steven.perry,

We don’t support adding the name when defining relationships with inline form at the moment. We’ll consider this ability in the future.

In DBML, there are 3 syntaxes to define relationships:

// Long form
Ref name_optional {
  schema1.table1.column1 < schema2.table2.column2
}

// Short form:
Ref name_optional: schema1.table1.column1 < schema2.table2.column2

// Inline form
Table schema2.table2 {
  id integer
  column2 integer [ref: > schema1.table1.column1]
}