Seperate event types in the trigger definition with OR

This commit is contained in:
eelke 2019-10-05 08:55:02 +02:00
parent 7f88b98cdd
commit 09d5461d01

View file

@ -91,12 +91,18 @@ QString PgTrigger::event() const
QString event; QString event;
if (type & TriggerTypeInsert) if (type & TriggerTypeInsert)
event += "INSERT "; event += "INSERT ";
if (type & TriggerTypeUpdate) if (type & TriggerTypeUpdate) {
if (!event.isEmpty()) event += "OR ";
event += "UPDATE "; event += "UPDATE ";
if (type & TriggerTypeDelete) }
if (type & TriggerTypeDelete) {
if (!event.isEmpty()) event += "OR ";
event += "DELETE "; event += "DELETE ";
if (type & TriggerTypeTruncate) }
if (type & TriggerTypeTruncate) {
if (!event.isEmpty()) event += "OR ";
event += "TRUNCATE"; event += "TRUNCATE";
}
return event.trimmed(); return event.trimmed();
} }