{"action":"created","issue":{"url":"https://api.github.com/repos/sukhoy94/mysql-tuts/issues/12","repository_url":"https://api.github.com/repos/sukhoy94/mysql-tuts","labels_url":"https://api.github.com/repos/sukhoy94/mysql-tuts/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/sukhoy94/mysql-tuts/issues/12/comments","events_url":"https://api.github.com/repos/sukhoy94/mysql-tuts/issues/12/events","html_url":"https://github.com/sukhoy94/mysql-tuts/issues/12","id":362463429,"node_id":"MDU6SXNzdWUzNjI0NjM0Mjk=","number":12,"title":"Triggers PLPGSQL","user":{"login":"sukhoy94","id":21118853,"node_id":"MDQ6VXNlcjIxMTE4ODUz","avatar_url":"https://avatars3.githubusercontent.com/u/21118853?v=4","gravatar_id":"","url":"https://api.github.com/users/sukhoy94","html_url":"https://github.com/sukhoy94","followers_url":"https://api.github.com/users/sukhoy94/followers","following_url":"https://api.github.com/users/sukhoy94/following{/other_user}","gists_url":"https://api.github.com/users/sukhoy94/gists{/gist_id}","starred_url":"https://api.github.com/users/sukhoy94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sukhoy94/subscriptions","organizations_url":"https://api.github.com/users/sukhoy94/orgs","repos_url":"https://api.github.com/users/sukhoy94/repos","events_url":"https://api.github.com/users/sukhoy94/events{/privacy}","received_events_url":"https://api.github.com/users/sukhoy94/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-21T05:47:04Z","updated_at":"2018-09-21T05:55:43Z","closed_at":null,"author_association":"OWNER","body":"```\r\nCREATE OR REPLACE FUNCTION log_last_name_changes()\r\nRETURNS trigger AS\r\n$BODY$\r\nBEGIN\r\n\tIF NEW.last_name <> OLD.last_name THEN\r\n\t\tINSERT INTO employee.audits(employee_id,last_name,changed_on)\r\n\t\tVALUES (OLD.id, OLD.last_name, now());\r\n\tEND IF;\r\nRETURN NEW;\r\nEND;\r\n$BODY$\r\nLANGUAGE plpgsql VOLATILE\r\nCOST 100;\r\n```"},"comment":{"url":"https://api.github.com/repos/sukhoy94/mysql-tuts/issues/comments/423421915","html_url":"https://github.com/sukhoy94/mysql-tuts/issues/12#issuecomment-423421915","issue_url":"https://api.github.com/repos/sukhoy94/mysql-tuts/issues/12","id":423421915,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzQyMTkxNQ==","user":{"login":"sukhoy94","id":21118853,"node_id":"MDQ6VXNlcjIxMTE4ODUz","avatar_url":"https://avatars3.githubusercontent.com/u/21118853?v=4","gravatar_id":"","url":"https://api.github.com/users/sukhoy94","html_url":"https://github.com/sukhoy94","followers_url":"https://api.github.com/users/sukhoy94/followers","following_url":"https://api.github.com/users/sukhoy94/following{/other_user}","gists_url":"https://api.github.com/users/sukhoy94/gists{/gist_id}","starred_url":"https://api.github.com/users/sukhoy94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sukhoy94/subscriptions","organizations_url":"https://api.github.com/users/sukhoy94/orgs","repos_url":"https://api.github.com/users/sukhoy94/repos","events_url":"https://api.github.com/users/sukhoy94/events{/privacy}","received_events_url":"https://api.github.com/users/sukhoy94/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T05:55:43Z","updated_at":"2018-09-21T05:55:43Z","author_association":"OWNER","body":"```\r\n-- Trigger: last_name_changes on public.employees\r\n\r\n-- DROP TRIGGER last_name_changes ON public.employees;\r\n\r\nCREATE TRIGGER last_name_changes\r\n  BEFORE UPDATE\r\n  ON public.employees\r\n  FOR EACH ROW\r\n  EXECUTE PROCEDURE public.log_last_name_changes();\r\n\r\n```"}}
{"actor":{"display_login":"sukhoy94"}}