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