- import script with write to file option - fix file names for functions - add generic (non edit tables) for only set date, set uid or combine - fix edit table edit_language insert data - all trigger create remove the drop on exists, as in the flow the trigger will never exists
13 lines
285 B
PL/PgSQL
13 lines
285 B
PL/PgSQL
-- adds the created or updated date tags
|
|
|
|
CREATE OR REPLACE FUNCTION set_date() RETURNS TRIGGER AS '
|
|
BEGIN
|
|
IF TG_OP = ''INSERT'' THEN
|
|
NEW.date_created := ''now'';
|
|
ELSIF TG_OP = ''UPDATE'' THEN
|
|
NEW.date_updated := ''now'';
|
|
END IF;
|
|
RETURN NEW;
|
|
END;
|
|
' LANGUAGE 'plpgsql';
|