Checks
What the Problems panel checks in an ER diagram, from broken relationships to tables that aren't related yet.
The Problems panel checks an ER diagram every time it changes. This page lists what it looks for. For how the panel and its levels work in every kind, see Modeling checks.
Errors
- A relationship refers to a table or column that isn't in the diagram.
- A relationship's two ends have different numbers of columns.
Warnings
- A table has no primary key.
- A relationship is many to many. Add a junction table between the two tables.
- A foreign key's type doesn't match the key it points at, such as
integerpointing atuuid. - A relationship points at a column that isn't a primary key or unique.
- A one-to-one relationship starts from a column that isn't unique.
Types that differ only in spelling or size don't count as a mismatch. For example, int pointing at integer, or varchar(100) at text, is fine.
To finish
These mark work that isn't done yet:
- A table isn't related to any other table. This only shows once the diagram has more than one table.
- A column looks like it points to another table but isn't related to it. For example,
orders.customer_idnext to acustomerstable whose key is one column of the same kind of type. - No column uses an enum.
- A group has no tables.
A column that looks like a key has Relate beside it, which adds the relationship. When there are several, Relate all next to To finish adds them all in one step. Importing SQL without foreign keys offers the same in the message that says it was imported.
When there's nothing to report, the panel says "Every table has a key and is related to another, and every relationship joins matching columns."