> For the complete documentation index, see [llms.txt](https://myroslavs-organization.gitbook.io/orm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://myroslavs-organization.gitbook.io/orm/api/decorators/trigger.md).

# Trigger

**Trigger Decorator**

The `Trigger` decorator is used to create triggers in the database. It takes a `TriggerDecoratorInterface` object as a parameter.

**Parameters of `TriggerDecoratorInterface`**

* **name:**
  * Type: `string`
  * Description: The name of the trigger.
* **actionTiming:**
  * Type: `TriggerActionTimingPostgres | TriggerActionTimingMysql`
  * Description: Defines the timing of the trigger execution (before or after an operation).
* **eventManipulation:**
  * Type: `TriggerEventManipulationPostgres | TriggerEventManipulationMysql`
  * Description: Defines the event that activates the trigger (INSERT, UPDATE, DELETE).
* **condition:**
  * Type: `string`
  * Description: The condition under which the trigger will execute.
* **forEachRow:**
  * Type: `boolean`
  * Description: Indicates whether the trigger should execute for each row being modified.
* **statement:**
  * Type: `string`
  * Description: The SQL query executed when the trigger is activated.
