{"action":"created","comment":{"url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments/30231142","id":30231142,"diff_hunk":"@@ -187,10 +187,13 @@ class Contact(models.Model):\n                                 on_delete=models.SET_NULL)\n     name = models.CharField(max_length=255, verbose_name='Full Name')\n     email = models.EmailField(max_length=255, verbose_name='Email', blank=True)\n-    phone = models.CharField(max_length=30, verbose_name='Phone', blank=True)\n+    phone = models.CharField(max_length=30, verbose_name='Phone', blank=True,\n+            default='')\n     locations = models.ManyToManyField('Location', related_name='contacts')\n     tags = models.ManyToManyField('Tag', null=True)\n-    notes = models.TextField(max_length=1000, verbose_name='Notes', blank=True)\n+    notes = models.TextField(max_length=1000, verbose_name='Notes',\n+                             blank=True, null=True)","path":"mypartners/models.py","position":null,"original_position":11,"commit_id":"12ec882bc408ea91f97ca258c7d84b7330bae420","original_commit_id":"ef86444f2d7a172e6794ab159dc6c64b47562b35","user":{"login":"aspidites","id":93686,"avatar_url":"https://avatars.githubusercontent.com/u/93686?v=3","gravatar_id":"","url":"https://api.github.com/users/aspidites","html_url":"https://github.com/aspidites","followers_url":"https://api.github.com/users/aspidites/followers","following_url":"https://api.github.com/users/aspidites/following{/other_user}","gists_url":"https://api.github.com/users/aspidites/gists{/gist_id}","starred_url":"https://api.github.com/users/aspidites/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspidites/subscriptions","organizations_url":"https://api.github.com/users/aspidites/orgs","repos_url":"https://api.github.com/users/aspidites/repos","events_url":"https://api.github.com/users/aspidites/events{/privacy}","received_events_url":"https://api.github.com/users/aspidites/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2015-05-13T13:43:52Z","updated_at":"2015-05-13T13:43:52Z","html_url":"https://github.com/DirectEmployers/MyJobs/pull/1496#discussion_r30231142","pull_request_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496","_links":{"self":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments/30231142"},"html":{"href":"https://github.com/DirectEmployers/MyJobs/pull/1496#discussion_r30231142"},"pull_request":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496"}}},"pull_request":{"url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496","id":34824977,"html_url":"https://github.com/DirectEmployers/MyJobs/pull/1496","diff_url":"https://github.com/DirectEmployers/MyJobs/pull/1496.diff","patch_url":"https://github.com/DirectEmployers/MyJobs/pull/1496.patch","issue_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/1496","number":1496,"state":"open","locked":false,"title":"[PD-1301] Establish relationship between Contact and ContactRecord","user":{"login":"aspidites","id":93686,"avatar_url":"https://avatars.githubusercontent.com/u/93686?v=3","gravatar_id":"","url":"https://api.github.com/users/aspidites","html_url":"https://github.com/aspidites","followers_url":"https://api.github.com/users/aspidites/followers","following_url":"https://api.github.com/users/aspidites/following{/other_user}","gists_url":"https://api.github.com/users/aspidites/gists{/gist_id}","starred_url":"https://api.github.com/users/aspidites/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspidites/subscriptions","organizations_url":"https://api.github.com/users/aspidites/orgs","repos_url":"https://api.github.com/users/aspidites/repos","events_url":"https://api.github.com/users/aspidites/events{/privacy}","received_events_url":"https://api.github.com/users/aspidites/received_events","type":"User","site_admin":false},"body":"## Description\r\nThis ticket's purpose is to establish a real foreign key relationship between the `Contact` and `ContactRecord` models. Doing so will allow for more efficient (and meaningful) queries for reports.\r\n\r\n## Changes\r\n- `ContactRecord` now has a `contact` field, which points to a contact\r\n- `ContactRecord` no longer has a contact_name field. As there will never be a case where this would differ in the contact record, it makes sense to simply keep it as the `Contact` instance's name. Should it need to change, one can either associate the `ContactRecord` to a different contact or change the contact's name. \r\n- `contact_email` remains in tact, as it could very well be the case that a record was made for communication that was sen to an email address other than the one associated with the contact. Same logic for `contact_phone`. \r\n- myreports has been updated to take advantage of the new relationship (**not done**)\r\n- `Contact`s cannot be deleted. Instead, they are simply archived. In doing so, we needn't worry about a contact being deleted causing information to be lost from a `ContactRecord`\r\n- `Contact` now has an `archived_on` datetime field, which notes when the contact was archived. A Null signifies a contact which hasn't been archived.\r\n- A contact is unarchived if a person attempts to create a contact with the same name and email address.\r\n\r\n## Migrations\r\n- Each of these migrations (including the data migration) have a backward migration associated with them, so things should be relatively safe. \r\n- The data migration is a set of raw queries, as doing so was way more efficient than the equivalent django query (feel free to prove me wrong).\r\n- The removal of `contact_name` and the addition of `archived_on` are two separate migrations because of the fact that the data migration relies on the existence of contact_name to do it's thing. The migrations happen as follows:\r\n    - `archived_on` field is added to `Contact`\r\n    - contacts are created in archived status from `ContactRecord`s whose `contact_name` and `contact_email` can't be traced back to a `Contact`. All contact records will then be associated with a contact.\r\n    - `contact_name` is deleted from `ContactRecord`\r\n\r\n","created_at":"2015-05-06T14:55:14Z","updated_at":"2015-05-13T13:43:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78920b5d7ae50320fe25b15ccdf721b68cfb761a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496/commits","review_comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496/comments","review_comment_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/1496/comments","statuses_url":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/12ec882bc408ea91f97ca258c7d84b7330bae420","head":{"label":"DirectEmployers:pd-1301","ref":"pd-1301","sha":"12ec882bc408ea91f97ca258c7d84b7330bae420","user":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=3","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"repo":{"id":2867982,"name":"MyJobs","full_name":"DirectEmployers/MyJobs","owner":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=3","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DirectEmployers/MyJobs","description":"Multi-user website designed to assist job seekers in their search for employment","fork":false,"url":"https://api.github.com/repos/DirectEmployers/MyJobs","forks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/forks","keys_url":"https://api.github.com/repos/DirectEmployers/MyJobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DirectEmployers/MyJobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DirectEmployers/MyJobs/teams","hooks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/hooks","issue_events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/events{/number}","events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/events","assignees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/assignees{/user}","branches_url":"https://api.github.com/repos/DirectEmployers/MyJobs/branches{/branch}","tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/tags","blobs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/{sha}","languages_url":"https://api.github.com/repos/DirectEmployers/MyJobs/languages","stargazers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/stargazers","contributors_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contributors","subscribers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscribers","subscription_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscription","commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/comments{/number}","contents_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contents/{+path}","compare_url":"https://api.github.com/repos/DirectEmployers/MyJobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DirectEmployers/MyJobs/merges","archive_url":"https://api.github.com/repos/DirectEmployers/MyJobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DirectEmployers/MyJobs/downloads","issues_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues{/number}","pulls_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls{/number}","milestones_url":"https://api.github.com/repos/DirectEmployers/MyJobs/milestones{/number}","notifications_url":"https://api.github.com/repos/DirectEmployers/MyJobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DirectEmployers/MyJobs/labels{/name}","releases_url":"https://api.github.com/repos/DirectEmployers/MyJobs/releases{/id}","created_at":"2011-11-28T15:22:36Z","updated_at":"2015-05-08T17:36:46Z","pushed_at":"2015-05-13T13:43:47Z","git_url":"git://github.com/DirectEmployers/MyJobs.git","ssh_url":"git@github.com:DirectEmployers/MyJobs.git","clone_url":"https://github.com/DirectEmployers/MyJobs.git","svn_url":"https://github.com/DirectEmployers/MyJobs","homepage":"http://my.jobs","size":36068,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":4,"default_branch":"quality-control"}},"base":{"label":"DirectEmployers:quality-control","ref":"quality-control","sha":"04bbb3354f9ee63333f999fca1d5c75ef54ca4f3","user":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=3","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"repo":{"id":2867982,"name":"MyJobs","full_name":"DirectEmployers/MyJobs","owner":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=3","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DirectEmployers/MyJobs","description":"Multi-user website designed to assist job seekers in their search for employment","fork":false,"url":"https://api.github.com/repos/DirectEmployers/MyJobs","forks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/forks","keys_url":"https://api.github.com/repos/DirectEmployers/MyJobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DirectEmployers/MyJobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DirectEmployers/MyJobs/teams","hooks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/hooks","issue_events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/events{/number}","events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/events","assignees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/assignees{/user}","branches_url":"https://api.github.com/repos/DirectEmployers/MyJobs/branches{/branch}","tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/tags","blobs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/{sha}","languages_url":"https://api.github.com/repos/DirectEmployers/MyJobs/languages","stargazers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/stargazers","contributors_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contributors","subscribers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscribers","subscription_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscription","commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/comments{/number}","contents_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contents/{+path}","compare_url":"https://api.github.com/repos/DirectEmployers/MyJobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DirectEmployers/MyJobs/merges","archive_url":"https://api.github.com/repos/DirectEmployers/MyJobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DirectEmployers/MyJobs/downloads","issues_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues{/number}","pulls_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls{/number}","milestones_url":"https://api.github.com/repos/DirectEmployers/MyJobs/milestones{/number}","notifications_url":"https://api.github.com/repos/DirectEmployers/MyJobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DirectEmployers/MyJobs/labels{/name}","releases_url":"https://api.github.com/repos/DirectEmployers/MyJobs/releases{/id}","created_at":"2011-11-28T15:22:36Z","updated_at":"2015-05-08T17:36:46Z","pushed_at":"2015-05-13T13:43:47Z","git_url":"git://github.com/DirectEmployers/MyJobs.git","ssh_url":"git@github.com:DirectEmployers/MyJobs.git","clone_url":"https://github.com/DirectEmployers/MyJobs.git","svn_url":"https://github.com/DirectEmployers/MyJobs","homepage":"http://my.jobs","size":36068,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":4,"default_branch":"quality-control"}},"_links":{"self":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496"},"html":{"href":"https://github.com/DirectEmployers/MyJobs/pull/1496"},"issue":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/1496"},"comments":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/1496/comments"},"review_comments":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496/comments"},"review_comment":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/1496/commits"},"statuses":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/12ec882bc408ea91f97ca258c7d84b7330bae420"}}}}