EPUB | CHM | PDF

Trigger Editor

Top Previous Next

Trigger Editor is placed within the Table Editor dialog on Triggers tab. It allows you to modify table triggers.

editor-table-triggers

The main element of the editor is the trigger list, which displays all the triggers in the table and their properties. These properties are as follows:

Trigger Name
The name of the trigger. It must be different from any other trigger name of the same table.

Trigger Time
Determines whether the function is called before or after the event.

Trigger Event
Indicates the kind of statement that activates the trigger. It can be INSERT, UPDATE, or DELETE.

Please note:
In MySQL the combination of Trigger Time and Trigger Event must be unique within a table. I.e. there must be no triggers with the same Trigger Time and Trigger Event in the same table.

Body
Statements to execute when the trigger activates. Press SQL Editor (sql-editor) button to edit trigger body SQL-script.

Definer
The DEFINER clause specifies the MySQL account to be used when checking access privileges at trigger activation time. If a user value is given, it should be a MySQL account in 'user_name'@'host_name' format (the same format used in the GRANT statement). The user_name and host_name values both are required. The definer can also be given as CURRENT_USER or CURRENT_USER(). The default DEFINER value is the user who executes the CREATE TRIGGER statement. (This is the same as DEFINER = CURRENT_USER).

Generate
Enables trigger creation during Database Generation and Database Modification.

The buttons under the list of triggers allow you to perform the following actions:

Add
Add a new trigger to the end of the list;

Delete
Remove the selected trigger from the list;

Up/Down
Move the selected trigger along the list.

See also:
Diagram Objects: Triggers | Table Editor