Steward Hub — Data Model
In relational databases, relationships between tables may be missing. Steward Hub allows you to manually complete missing relationships and then add them to the source database.
View
To assist you in properly representing the relationships in your database, the Data Model module can assist you by offering suggestions for:
- primary keys (PK) [1]
- foreign keys (FK) [2]

Primary Keys (PK)
The Primary Keys module is able to suggest Primary Keys based on table metadata (isnullable and isunique parameters). It also shows all tables that do not have a Primary Key yet, even if a suggestion of a suitable key is not possible.
Verify primary key suggestions
Clicking the Verify PK suggestions text, opens up a table with suggested keys. The table rows, contains: the name of a Table for which a PK is suggested, name of the column which is the candidate key, whether it is nullable, whether it is an Identity column, its datatype, the source of the Table, and a PK name suggested by the Steward Hub.
You can filter through the suggestions using search bars under the Table name [1], Column name [2], and Datatype [3] headers.

If you are not satisfied with the suggested name for your PK, you can modify it in the PK name cell, by pressing the Edit button.

There are two ways to manage suggested primary keys: either individually or in bulk.
To manage an individual key, locate its corresponding row in the table. If you want to accept the suggestion, click the Approve button. A pop-up will appear prompting you to confirm your choice. Once you do, a new PK will be added.
Clicking the Reject button instead, opens a pop-up prompting you to confirm the deletion. Selecting Confirm permanently rejects the Primary Key suggestion — it will not show up, even after a refresh of suggestions.

To accept or reject PK suggestions in bulk, first select all the keys you want to manage using checkboxes next to their respective rows [1]. Then, you can bulk-reject or accept the suggestions using the buttons in the top part of the page [2]. You will have to confirm your choice in a pop-up that appears.

Create primary keys manually
Clicking the Create PK manually text, opens up a table showing all Views in Tables in your repository that do not have a primary key. You can view the table's name, its source, as well as its number of records. If you need to review the table, you can click on its name, to be taken to the object's view.
Manual creation of Primary Keys is only possible for one object at a time. To start the process, click the Add PK button next to the object you are interested in.

This opens a PK creation wizard, where you can see an overview of the selected source's position in the Database, and its structure. The Name field lets you select how the PK is named, and you can add extra context in the Description field. Finally, you can choose which column of the selected source is the primary key.
You can restrict shown information using the Column chooser.

Foreign Keys (FK)
Foreign Keys are suggested based on detected relationships between sources in your data that have not been documented yet.
They are displayed as a list of occurrences of (potential) Foreign tables in Data Sources. You can expand or collapse each entry using the arrow icon.

The expanded view shows the proposed foreign column [1] and the target object's column it is used in [3]. Data types are also shown, as well as the type of relation [2]. Dataedo Steward Hub codifies foreign key relations as many-to-one by default.

In the expanded view, you can use the Reject button to permanently remove a FK suggestion, or the Approve button to open the foreign key creation wizard.

In the wizard, you can use the Name and Title fields to provide descriptors of the new FK, and optionally provide extra details in the Description field.
Below that, there is a section with paired displays for Foreign Key and Primary Key. The dropdown in Cardinality lets you specify the type of relationship between tables and columns (many-to-one or one-to-one). This affects how the Entity Relationship Diagrams are displayed in your repository. You can also modify the Data Source and Table where the Primary Key should be located.
In the bottommost section, you can define which column pairs participate in the relationship.
Once all details are provided, click Add Relationship to save it.

Bulk Foreign Keys rejection
You can reject Foreign Keys in bulk. To do so, use checkboxes [1] to select all the proposed Keys you want to reject, and press the Reject selected button [2].
