Indexes / Constraints
Learn how to manage PK, FK, and Indexes (including Unique) in the Schema Editor.
Primary Key (PK)
Set up and manage the primary key of a table.
Set PK in Schema Editor
When you open a table, the Table Columns grid is displayed in the Schema Editor. Select the "PK" checkbox for the column you want to designate as PK.
Composite PK
Select the PK checkbox on multiple columns to set a composite Primary Key.

Columns with PK set are automatically shown as a PRIMARY index with Type "UNIQUE" in the Indexes section below.
Foreign Key (FK)
Manage foreign keys that define referential relationships between tables.
Check Foreign Keys Section
View the FK list for the current table in the Foreign Keys section at the bottom of the Schema Editor.
Add FK
Click the "+ ADD FOREIGN KEY" button to open the FK creation modal.
Map Referenced Table & Columns
Select the referenced table in the modal, and its PK columns will be auto-displayed. Map a type-compatible column from the current table, or toggle "New Column" to create a new column.
Confirm FK Name
The FK name is auto-generated in the format fk__to_. You can modify it manually if needed.

| FK List Column | Description |
|---|---|
| FK Name | Foreign key name |
| FK Column(s) | FK column(s) in the current table |
| Referenced Table | Referenced table |
| Referenced Column(s) | Column(s) in the referenced table |
| Actions | FK delete button |
Index Management
Create and manage indexes for query performance optimization. Unique constraints are also set through index creation.
Check Indexes Section
View the index list for the current table in the Indexes section at the bottom of the Schema Editor.
Add Index
Click the "+ ADD INDEX" button to open the index creation modal.
Set Index Name & Options
Enter the index name. If a Unique Index is needed, select the "Unique" checkbox.
Select Columns & Sort Order
Select columns from the left "Available Columns" list and move them to the right "Selected Columns". Use drag & drop or arrow buttons to move/reorder columns. Double-click a selected column to toggle its sort order (ASC/DESC).

| Index List Column | Description |
|---|---|
| Index Name | Index name |
| Type | UNIQUE or INDEX |
| Column(s) | Columns included in the index |
| Index Type | Index type (BTREE, etc.) |
| Actions | Index delete button |
Note: Unique constraints are not a separate setting. Instead, select the "Unique" checkbox when adding an index. Selecting multiple columns creates a composite Unique index.
