1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-- Deploy diary:update_updated_at to pg -- requires: schema BEGIN; SET search_path to diary; CREATE OR REPLACE FUNCTION update_updated_at() RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; COMMIT;