hicli/database: fix edit triggers
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run

This commit is contained in:
Tulir Asokan 2024-10-14 01:54:29 +03:00
commit 67b1c97f14

View file

@ -121,7 +121,7 @@ BEGIN
WHERE event_id = NEW.relates_to
AND last_edit_rowid = NEW.rowid
AND state_key IS NULL
AND relation_type NOT IN ('m.replace', 'm.annotation');
AND (relation_type IS NULL OR relation_type NOT IN ('m.replace', 'm.annotation'));
END;
CREATE TRIGGER event_insert_update_last_edit
@ -137,7 +137,7 @@ BEGIN
AND type = NEW.type
AND sender = NEW.sender
AND state_key IS NULL
AND relation_type NOT IN ('m.replace', 'm.annotation')
AND (relation_type IS NULL OR relation_type NOT IN ('m.replace', 'm.annotation'))
AND NEW.timestamp >
COALESCE((SELECT prev_edit.timestamp FROM event prev_edit WHERE prev_edit.rowid = event.last_edit_rowid), 0);
END;