Create Foreign Key Link Dialog Help
Valentina Studio allows to create Foreign Key Link using a special dialog. You can invoke the dialog from the Schema Editor, by two ways:
- Through contextual menu of the database by Create → Link item.
- Through contextual menu of the table by Create → Link item.
The dialog provides a possibilities to setup properties of the link:
- Link Name – The name of the schema object.
- Link Kind – The kind of link. The current dialog allows to create three kinds of links:
- Binary Link – Only for Valentina.
- ObjectPtr Link – Only for Valentina.
- Foreign Key Link – For any supported datasource.
- On Delete – The action, that specifies what should happens with Child-records when you delete a parent record in the linked table.
- On Update – The action, that specifies what should happens with child records when you UPDATE the PRIMARY KEY of a parent record.
- Table – The name of the referencing table.
- Power – The power of the link by the referencing table. For a Foreign Key Link can be 1 or M.
- Referenced Table – The name of the referenced table.
- Power – The power of the link by the referencing table. For a Foreign Key Link can be 1 or M.
- Fields of the Referencing Table – The list of the referencing fields of the link.
- Fields of the Referenced Table – The list of the referenced fields of the link.
Pay attention: The fields, that takes a role in the creation of the Foreign Key Link, should be present in the referenced table and in the referencing tables, before creating the link. The dialod only offers to chose corresponding fields.
Use arrows in the panel below the list of fields to change the order of fields.
- Show SQL – Opens dialog, that shows a SQL query, that will be applied to the datasource, to create the link.