add ancestry check

This commit is contained in:
CJ Cobb
2021-03-24 14:46:48 -04:00
parent c74f9654af
commit 14fd6d24ad
5 changed files with 23 additions and 13 deletions

View File

@@ -863,6 +863,8 @@ BEGIN
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER verify_ancestry BEFORE INSERT OR UPDATE on ledgers
FOR EACH ROW EXECUTE PROCEDURE insert_ancestry();
-- Trigger function prior to delete on ledgers table. Disallow gaps from
-- forming. Do not allow deletions if both the previous and next ledgers