Skip to main content

Documenting primary and unique keys

Primary and unique keys

Dataedo imports table primary and unique keys. Those unique keys might be unique indexes or unique constraints in the case of Oracle. They are presented in one table in the Unique keys tab.

To describe unique keys, edit the text in the description field.

Unique keys

Missing logical keys

Sometimes, a logically existing primary or unique key is not physically coded in the database. Similar logical constraints may also exist on views. Dataedo allows you to add them both to your tables and views by using user-defined keys.

Adding user-defined primary or unique keys

Note: User-defined unique keys and relations exist only in the Dataedo repository and are not populated back to the database schema.

To add a user-defined primary or unique key for your table/view, go to the Unique keys tab and click the Add primary key or Add unique key button on the ribbon or from the context menu under right-click.

Image title

or

Add key

This will open a key form:

  • Name - name of the key. It is optional, a default name will be set after saving
  • Type - you must choose a type of key - primary or unique
  • Columns - you must choose from a dropdown one or more columns that will be part of your key
  • Description - you may provide a description of your key. This is the same field as in the table of keys
User-defined unique key

Once you have provided all the fields, click OK to add a key. The new key will be added to the table of keys. Note that user-defined keys have icons with a blue man (User-defined primary keyUser-defined unique key).

New user-defined key

Editing user-defined primary or unique keys

To edit a key, select it in the table and click the Edit key button on the ribbon or from the context menu under right-click.

Edit key button
Edit key

The same form will open, and you will be able to provide changes.