Add a foreign key to a database table
In this topic, you learn how to integrate a key from another database table to your database table.
You add foreign keys to link multiple database tables by using a shared key.
Prerequisites
-
You have configured a table definition.
-
You have added properties to the table definition.
Procedure
-
In the Cockpit, go to Tools and select Table Definition.
-
Open your database table.
-
In the Properties tab, select Foreign Keys on the toolbar.
Result: The Foreign Keys dialog opens.
-
On the dialog toolbar, select + Add Foreign Key.
Result: The Table Definition dialog opens.
-
Select the table you want to take the keys from.
Result: You return to the Foreign Keys dialog.
-
From the dropdown menu on the toolbar, select the column from your current table that you want to bind the keys to.
-
Select + Add Column.
-
In Referenced Columns, select the column from the other table you want to get the keys from.
-
Select Apply.
Result
-
You have added a foreign key to the database table.
-
You can see the number of foreign keys added next to Foreign Keys on the table toolbar.