Properties
Every field the Properties panel shows for a table, column, relationship, enum, group or note in an ER diagram.
The Properties panel shows every field the diagram stores for what you've selected. This page lists the fields for each element of an ER diagram. For how the panel works in every kind, see The Properties panel.
To open it, choose Properties in More (⋯) on the selection bar. Or press ⌥ ⌘ P (Alt Ctrl P on Windows and Linux).
The diagram
With nothing selected, the panel shows the diagram's own fields.
| Field | What it holds |
|---|---|
| Title | The diagram's name. |
| Database | Not set, PostgreSQL, MySQL, SQL Server, SQLite or Oracle. It sets the types the assistant writes. |
| Note | What the schema is for. |
Below them, the panel counts the tables, relationships and enums, and lists the tables.
A table
| Field | What it holds |
|---|---|
| Name | The table's name. |
| Model | The entry in your team's Model this table matches. |
| Schema | The database schema the table is in. Leave it empty for the default one. |
| Alias | A short name the code can use for the table in relationships, as in Table orders as o. |
| Group | The group the table is in. It shows once the diagram has groups. |
| Columns | A grid of each column's Name, Type, Key and Null, with Add column below it. |
| Indexes | The table's indexes, apart from its primary key. Open one to change its Columns, Unique, Name, Type and Note, or to remove it. Add index adds one. |
| Checks | Rules every row must pass, such as end_date > start_date. Open one to change its Expression and Name, or to remove it. Add check adds one. |
| Note | What one row is, such as "One per order". |
| Colour | The header's colour. |
| Relationships | The table's relationships. Select one to go to it. |
When several columns are ticked under Key, they make a composite key together. A table that takes columns from a partial, or holds sample rows, also lists those.
An index's Type is Default, btree, hash, gin, gist or brin.
A column
| Field | What it holds |
|---|---|
| Name | The column's name. |
| Type | Such as integer, varchar(255), timestamp, or an enum's name. |
| Primary key, Unique, Not null, Auto-increment | Tick to turn each on. A key column is always unique and not null. |
| Default | The value a new row gets when none is given. |
| Check | A rule every value must pass, such as price >= 0. |
| Relationships | The column's relationships. |
| Note | What the column holds, when its name doesn't say. |
Default takes a value as the code writes it: 0, true, 'draft' in single quotes, or an expression in backticks, such as `now()`.
A column that comes from a partial shows its fields read only. Change it in the code, where the partial is written.
A relationship
| Field | What it holds |
|---|---|
| From and To | The two ends. Select one to go to that column. |
| Columns | The pairs of columns it joins. Add column pair relates a composite key. |
| Cardinality | Many to one, One to one or Many to many. |
| Reference | Required or Optional, with a sentence saying what that means. |
| On delete and On update | What the database does to these rows when the row they point at is deleted, or its key changes. |
| Name | The foreign key's name in SQL. |
| Colour | The line's colour. |
| Flip direction | Swaps which side holds the reference. |
Setting Reference to Required makes the referencing columns Not null. A many-to-many relationship has no Reference. Instead, a sentence suggests a junction table.
On delete and On update take Default, cascade, restrict, set null, set default or no action.
An enum
| Field | What it holds |
|---|---|
| Name | The enum's name. |
| Schema | The database schema it's in. |
| Values | A grid of each value and its Note, which says what the value means. Add value adds one, and each value has a button to remove it. |
| Colour | The header's colour. |
| Used by | The columns of its type. |
A group
| Field | What it holds |
|---|---|
| Name | The group's name. |
| Tables | The tables in it. To put a table in a group, pick the group in the table's properties. |
| Note | What these tables are for. |
| Colour | The frame's colour. |
A note
| Field | What it holds |
|---|---|
| Text | What a reader should know. |
| Name | The name the code gives the note. |
| Colour | The note's colour. |
Each element shows its id at the bottom, with a Copy id button.