Avoid failure if the trigger doesn't exist

I'm not entirely sure how this happens, but I came across a node that
was failing here because the trigger didn't exist -- possibly from a
partial upgrade?

In any case, the `IF EXISTS` makes it more lenient.
This commit is contained in:
Jason Rhinelander 2022-07-19 22:47:57 -03:00
parent 46f0fd025c
commit 3015683511
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ namespace cryptonote {
CREATE INDEX batched_payments_accrued_payout_offset_idx ON batched_payments_accrued(payout_offset);
DROP TRIGGER rollback_payment;
DROP TRIGGER IF EXISTS rollback_payment;
CREATE TRIGGER rollback_payment INSTEAD OF DELETE ON batched_payments_paid
FOR EACH ROW BEGIN
DELETE FROM batched_payments_raw WHERE address = OLD.address AND height_paid = OLD.height_paid;