Files
development/4dev/database/function/set_generic.sql
Clemens Schwaighofer bddc196e25 Login password min length, boolean default set if empty
Also remove all inserts from the table declaration and add them in a
separate file instead

Add add/remove css to element for the element js declarations
2018-07-04 18:58:07 +09:00

13 lines
301 B
PL/PgSQL

-- adds the created or updated date tags
CREATE OR REPLACE FUNCTION set_generic() RETURNS TRIGGER AS '
BEGIN
IF TG_OP = ''INSERT'' THEN
NEW.cuid := random_string(random_length);
ELSIF TG_OP = ''UPDATE'' THEN
NEW.date_updated := ''now'';
END IF;
RETURN NEW;
END;
' LANGUAGE 'plpgsql';