{"action":"created","issue":{"url":"https://api.github.com/repos/musaffa/polymorphic_constraints/issues/1","repository_url":"https://api.github.com/repos/musaffa/polymorphic_constraints","labels_url":"https://api.github.com/repos/musaffa/polymorphic_constraints/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/musaffa/polymorphic_constraints/issues/1/comments","events_url":"https://api.github.com/repos/musaffa/polymorphic_constraints/issues/1/events","html_url":"https://github.com/musaffa/polymorphic_constraints/issues/1","id":358127855,"node_id":"MDU6SXNzdWUzNTgxMjc4NTU=","number":1,"title":"For Postgres, use constraint triggers?","user":{"login":"pjungwir","id":660353,"node_id":"MDQ6VXNlcjY2MDM1Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/660353?v=4","gravatar_id":"","url":"https://api.github.com/users/pjungwir","html_url":"https://github.com/pjungwir","followers_url":"https://api.github.com/users/pjungwir/followers","following_url":"https://api.github.com/users/pjungwir/following{/other_user}","gists_url":"https://api.github.com/users/pjungwir/gists{/gist_id}","starred_url":"https://api.github.com/users/pjungwir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjungwir/subscriptions","organizations_url":"https://api.github.com/users/pjungwir/orgs","repos_url":"https://api.github.com/users/pjungwir/repos","events_url":"https://api.github.com/users/pjungwir/events{/privacy}","received_events_url":"https://api.github.com/users/pjungwir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-07T16:10:33Z","updated_at":"2018-09-07T16:19:52Z","closed_at":null,"author_association":"NONE","body":"I'm so glad that someone has already written a gem for this!\r\n\r\nI was looking at your Postgres adapter code, and what do you think of using `CREATE CONSTRAINT TRIGGER` instead? That is how Postgres implements its own foreign keys, and it would let you do `SET CONSTRAINTS` on these like you can with regular foreign keys. It would require changing the triggers from `BEFORE` to `AFTER`, but that doesn't look like a problem to me.\r\n\r\nIncidentally, you should technically have an `UPDATE` trigger on the same table as the `DELETE` trigger in case the primary key changes, although I understand that is unlikely to happen in a Rails app."},"comment":{"url":"https://api.github.com/repos/musaffa/polymorphic_constraints/issues/comments/419491508","html_url":"https://github.com/musaffa/polymorphic_constraints/issues/1#issuecomment-419491508","issue_url":"https://api.github.com/repos/musaffa/polymorphic_constraints/issues/1","id":419491508,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTQ5MTUwOA==","user":{"login":"musaffa","id":294616,"node_id":"MDQ6VXNlcjI5NDYxNg==","avatar_url":"https://avatars0.githubusercontent.com/u/294616?v=4","gravatar_id":"","url":"https://api.github.com/users/musaffa","html_url":"https://github.com/musaffa","followers_url":"https://api.github.com/users/musaffa/followers","following_url":"https://api.github.com/users/musaffa/following{/other_user}","gists_url":"https://api.github.com/users/musaffa/gists{/gist_id}","starred_url":"https://api.github.com/users/musaffa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musaffa/subscriptions","organizations_url":"https://api.github.com/users/musaffa/orgs","repos_url":"https://api.github.com/users/musaffa/repos","events_url":"https://api.github.com/users/musaffa/events{/privacy}","received_events_url":"https://api.github.com/users/musaffa/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T16:19:52Z","updated_at":"2018-09-07T16:19:52Z","author_association":"OWNER","body":"I don't personally use this gem anymore. Polymorphism is an antipattern in database system design. We should use alternative solutions although they aren't very pleasant ones."}}
{"actor":{"display_login":"musaffa"}}