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.
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.
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.
| Item | Description |
|---|---|
| FK Name | The foreign key constraint name. |
| FK Column(s) | Columns in the child table that hold referenced values. |
| Referenced Table | The parent table. |
| Referenced Column(s) | Referenced columns in the parent table. Usually PK or UNIQUE columns. |
| Actions | Delete 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.
| Display | Meaning |
|---|---|
| INDEX | A regular index for query performance. |
| UNIQUE | An index that does not allow duplicate values. |
| Column(s) | The order of columns included in the index. |
| Index Type | DBMS-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 Order | Sets ASC/DESC per column for supported index types. |
| INCLUDE | Includes non-key columns in supported PostgreSQL versions and SQL Server indexes. |
| WHERE | Sets partial/filter index conditions in PostgreSQL or SQL Server. |
| Expression | Sets 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.
| DBMS | Deferrable Support |
|---|---|
| PostgreSQL | FK, UNIQUE, CHECK, and EXCLUSION |
| Oracle | FK and UNIQUE |
| SQLite | FK |
Options unsupported by the DBMS or version are not shown in the input UI. Review the final DDL in the preview before applying.
