{"action":"created","issue":{"url":"https://api.github.com/repos/shimizukawa/django-redshift-backend/issues/42","repository_url":"https://api.github.com/repos/shimizukawa/django-redshift-backend","labels_url":"https://api.github.com/repos/shimizukawa/django-redshift-backend/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/shimizukawa/django-redshift-backend/issues/42/comments","events_url":"https://api.github.com/repos/shimizukawa/django-redshift-backend/issues/42/events","html_url":"https://github.com/shimizukawa/django-redshift-backend/pull/42","id":339227252,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5OTQyODk2","number":42,"title":"Add support for distkey.","user":{"login":"benjyw","id":512764,"node_id":"MDQ6VXNlcjUxMjc2NA==","avatar_url":"https://avatars2.githubusercontent.com/u/512764?v=4","gravatar_id":"","url":"https://api.github.com/users/benjyw","html_url":"https://github.com/benjyw","followers_url":"https://api.github.com/users/benjyw/followers","following_url":"https://api.github.com/users/benjyw/following{/other_user}","gists_url":"https://api.github.com/users/benjyw/gists{/gist_id}","starred_url":"https://api.github.com/users/benjyw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjyw/subscriptions","organizations_url":"https://api.github.com/users/benjyw/orgs","repos_url":"https://api.github.com/users/benjyw/repos","events_url":"https://api.github.com/users/benjyw/events{/privacy}","received_events_url":"https://api.github.com/users/benjyw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-08T13:46:05Z","updated_at":"2018-07-09T21:55:50Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/shimizukawa/django-redshift-backend/pulls/42","html_url":"https://github.com/shimizukawa/django-redshift-backend/pull/42","diff_url":"https://github.com/shimizukawa/django-redshift-backend/pull/42.diff","patch_url":"https://github.com/shimizukawa/django-redshift-backend/pull/42.patch"},"body":"Subject: Add support for setting a DISTKEY.\r\n\r\n### Feature or Bugfix\r\n- Feature\r\n\r\n### Purpose\r\nSetting a DISTKEY is a basic requirement in real-world Redshift clusters. \r\nThis change adds support for designating a column as the DISTKEY.\r\nThere are some complications and caveats, explained in the README.\r\n\r\n\r\n### Detail\r\nThis is implemented by setting a custom index type in the model's meta class:\r\n\r\n```\r\nfrom django_redshift_backend.base import DistKey\r\n...\r\nclass Fact(Model):\r\n  class Meta:\r\n    indexes = [DistKey(fields=['dim1'])]\r\n\r\n  dim1 = ForeignKey(Dimension1Model)\r\n```\r\n\r\nBut, as explained in the README, this will likely require some hand-editing\r\nof the migration files, so that all necessary information is available at \r\ntable creation time.\r\n\r\nThis change also fixes a minor issue with the SORTKEY support, where\r\nit was assumed that the db column name was the same as the field name.\r\nBut this is not the case, e.g., for ForeignKey fields.\r\n\r\nThis change also replaces references to the defunct `remote_field.to` with\r\nthe `remote_field.related_model`.\r\n\r\n### Relates\r\nhttps://github.com/shimizukawa/django-redshift-backend/issues/16\r\nhttps://github.com/shimizukawa/django-redshift-backend/pull/20\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/shimizukawa/django-redshift-backend/issues/comments/403633065","html_url":"https://github.com/shimizukawa/django-redshift-backend/pull/42#issuecomment-403633065","issue_url":"https://api.github.com/repos/shimizukawa/django-redshift-backend/issues/42","id":403633065,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzYzMzA2NQ==","user":{"login":"benjyw","id":512764,"node_id":"MDQ6VXNlcjUxMjc2NA==","avatar_url":"https://avatars2.githubusercontent.com/u/512764?v=4","gravatar_id":"","url":"https://api.github.com/users/benjyw","html_url":"https://github.com/benjyw","followers_url":"https://api.github.com/users/benjyw/followers","following_url":"https://api.github.com/users/benjyw/following{/other_user}","gists_url":"https://api.github.com/users/benjyw/gists{/gist_id}","starred_url":"https://api.github.com/users/benjyw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjyw/subscriptions","organizations_url":"https://api.github.com/users/benjyw/orgs","repos_url":"https://api.github.com/users/benjyw/repos","events_url":"https://api.github.com/users/benjyw/events{/privacy}","received_events_url":"https://api.github.com/users/benjyw/received_events","type":"User","site_admin":false},"created_at":"2018-07-09T21:55:50Z","updated_at":"2018-07-09T21:55:50Z","author_association":"CONTRIBUTOR","body":"Addressed comments and fixed style errors."}}
{"actor":{"display_login":"benjyw"}}