# RelationDefinition

**Kind:** Interface

**Source:** [`atloria-monorepo/libs/parser-core/src/interfaces/entity.interface.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/interfaces/entity.interface.ts#L780)

Relation definition between models

## Properties

| Property | Type |
|---|---|
| `name` | `string` |
| `type` | `'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many'` |
| `targetModel` | `string` |
| `foreignKey` | `string` |
| `onDelete` | `'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION'` |
| `onUpdate` | `'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION'` |
| `relationTable` | `string` |
