Skip to content

DbMapping Indexes

The indexes section is where you can configure, for your dbMapping, indexes for the database table columns.

Fields

A index contain the following fields to be defined:

Properties

A collection of properties from the entity whose index will be created.

Requirements Rules:

  • Is Required;
  • All property names in the collection keys must exist for the current entity;

Example:

1
2
Indexes:
- Properties: [Property1]


IsUnique

Allows you to define these properties as unique in the table (default: false). Attempting to insert more than one entity with the same values for the index's property set will throw an exception.

Even with Unique enabled, it's possible to change the value of the index properties.

Example:

1
2
3
Indexes:
- Properties: [Property1]
  IsUnique: true


Back to top