Add constraints or indexes
The Business Application Modeler requires that tables are defined with primary keys. Constraints and indexes that are part of the database structure are displayed as part of the table, but additional constraints (such as primary keys) can be added.
Right-click the table in the meta-schema diagram and select Add Constraint or Index.
Specify the index type. While you have four options avaiable, only the Primary Key option will have any influence when generating your report application.
- Primary Key
- A Primary Key is a column or set of columns that uniquely identifies a row of data. The Not Null property must be set on the columns used in a Primary Key. The Not Null property indicates the column does not allow NULL values. It is used by the generation and update scripts when generating the SQL statements used to manage the database.
- Secondary Key
- Also known as a Unique Constraint. Like Primary Key, the Secondary Key ensure uniqueness on the columns it is defined, but also allows NULL values.
- Index
-
An index improves the speed of looking up data in tables. Indexes can be defined on one or more table column.
- Unique Index
- Unique Index behaves the same as an Unique Constraint. It ensures the data in the column is unique. The difference between a Unique Constraint and a Unique Index depends on the database engine.
The index can be viewed in the Structure view.
Select the index to display its properties in the Properties view.
If an index contains more than one column, the order of the columns is indicated.