Keys & Indexes

In the ERD, PK, FK, Index, and Constraint settings are managed together with the table structure.

Primary Key

Set PK from the column grid in the table node. If multiple columns are marked as PK, they are handled as a composite PK.

Tip

Changing a PK can affect FKs. Review the preview before applying changes to the actual DB.

Foreign Key

Add an FK by drawing a relationship line or by using the Add Foreign Key button in the detail panel. In the detail panel, you can review the FK name, FK columns, and referenced table.

Note:

In an all-Schema ERD, you can also reference tables from another Schema in the same Database. In this case, referenced tables are distinguished in schema.table format.

ItemDescription
FK NameThe foreign key constraint name.
FK Column(s)Columns in the child table that hold referenced values.
Referenced TableThe parent table.
Referenced Column(s)Referenced columns in the parent table. Usually PK or UNIQUE columns.
ActionsDelete the FK or recreate it through a relationship line.

Index

Manage regular indexes and UNIQUE indexes from the Indexes area in the detail panel. You can choose a DBMS-specific index type and configure options such as column order, sort direction, INCLUDE columns, tablespace, and WHERE condition.

DisplayMeaning
INDEXA regular index for query performance.
UNIQUEAn index that does not allow duplicate values.
Column(s)The order of columns included in the index.
Index TypeDBMS-specific choices are shown, such as PostgreSQL B-Tree/GIN/GiST, Oracle Normal/Bitmap/Function-Based, MySQL/MariaDB B-Tree/Full-Text/Spatial, and SQL Server Clustered/Nonclustered/Columnstore.
Sort OrderSets ASC/DESC per column for supported index types.
INCLUDEIncludes non-key columns in supported PostgreSQL versions and SQL Server indexes.
WHERESets partial/filter index conditions in PostgreSQL or SQL Server.
ExpressionSets the expression for an Oracle Function-Based index.

Constraints

The Constraints area in the detail panel shows constraints such as PK, FK, UNIQUE, and CHECK together. PostgreSQL also supports adding EXCLUSION constraints.

DBMSDeferrable Support
PostgreSQLFK, UNIQUE, CHECK, and EXCLUSION
OracleFK and UNIQUE
SQLiteFK
Note:

Options unsupported by the DBMS or version are not shown in the input UI. Review the final DDL in the preview before applying.