Insert operation for UserOperation_donor_update view

This commit is contained in:
Bradley M. Kuhn 2022-11-21 15:24:27 -08:00
parent 225eb13674
commit d0b7f15f2a

View file

@ -294,6 +294,14 @@ CREATE VIEW UserOperation_donor_update AS
FROM donor
ORDER BY donor.ledger_entity_id, donor.id;
DROP TRIGGER IF EXISTS donor_update_insert_new_donor;
CREATE TRIGGER donor_update_insert_new_donor
INSTEAD OF INSERT ON UserOperation_donor_update
BEGIN
INSERT INTO donor(ledger_entity_id, display_name, public_ack, rt_ticket, is_supporter)
VALUES(NEW.donor_name, NEW.public_name, NEW.public_acknowledge, NEW.ticket, 1);
END;
DROP TRIGGER IF EXISTS donor_update_display_name;
CREATE TRIGGER donor_update_display_name
INSTEAD OF UPDATE OF public_name on UserOperation_donor_update