let's get build_app running on a masterref database
[xtuple] / foundation-database / public / trigger_functions / report.sql
1 CREATE OR REPLACE FUNCTION _reportTrigger () RETURNS TRIGGER AS '
2 -- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
3 -- See www.xtuple.com/CPAL for the full text of the software license.
4 BEGIN
5
6   NEW.report_loaddate = CURRENT_TIMESTAMP;
7   RETURN NEW;
8
9 END;
10 ' LANGUAGE 'plpgsql';
11
12 DROP TRIGGER IF EXISTS reportTrigger ON report;
13 CREATE TRIGGER reportTrigger BEFORE INSERT OR UPDATE ON report FOR EACH ROW EXECUTE PROCEDURE _reportTrigger();