{"action":"created","issue":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4950","repository_url":"https://api.github.com/repos/CenterForOpenScience/osf.io","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4950/labels{/name}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4950/comments","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4950/events","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4950","id":129226117,"number":4950,"title":"[Ready to Review] Eliminate backrefs between Nodes and NodeLogs","user":{"login":"pattisdr","id":9755598,"avatar_url":"https://avatars.githubusercontent.com/u/9755598?v=3","gravatar_id":"","url":"https://api.github.com/users/pattisdr","html_url":"https://github.com/pattisdr","followers_url":"https://api.github.com/users/pattisdr/followers","following_url":"https://api.github.com/users/pattisdr/following{/other_user}","gists_url":"https://api.github.com/users/pattisdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pattisdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattisdr/subscriptions","organizations_url":"https://api.github.com/users/pattisdr/orgs","repos_url":"https://api.github.com/users/pattisdr/repos","events_url":"https://api.github.com/users/pattisdr/events{/privacy}","received_events_url":"https://api.github.com/users/pattisdr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/64","html_url":"https://github.com/CenterForOpenScience/osf.io/milestones/0.65.0","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/64/labels","id":1571055,"number":64,"title":"0.65.0","description":"","creator":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":15,"state":"open","created_at":"2016-02-08T18:49:46Z","updated_at":"2016-02-23T16:24:42Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-01-27T18:16:45Z","updated_at":"2016-02-23T18:55:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4950","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4950","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/4950.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/4950.patch"},"body":"# Purpose\r\n\r\nIssue https://openscience.atlassian.net/browse/OSF-5471\r\n\r\nThere are many log entries, and projects with many logs have trouble loading their logs - this may be causing problems with file management concurrency.  Removing the backrefs between Nodes and NodeLogs should help.  NodeLogs are currently shared between nodes, registrations, and forks. As of this PR, this is no longer the case.\r\n\r\n# Changes\r\n1) Removed logs field off of nodes (but left data in db)\r\n2) Made logs a property of nodes\r\n3) Added `original_node` and `node` fields to NodeLogs\r\n4) Removed `node` property off of NodeLogs\r\n5) Created a script to go through all the NodeLogs, and for every registration/fork in the backrefs, clone the NodeLog with `original_node` set equal to the original node(params['node']) and the `node` set equal to the current node.  For the original log, `original_node` and `node` will be equal, but for the cloned logs, `node` will be either the registration or fork.\r\n6) When making a registration or fork, clone the logs on the original node and point them to the reg/fork\r\n7) Removed API endpoint v2/logs/{log_id}/nodes/ since each log only pertains to one node.\r\n8) Changed the log relationship \"nodes\", to \"node\", with a NodeDetail link.\r\n9) Lots of cleanup.\r\n \r\n# Side Effects\r\nWill require a migration. \r\n\r\nThere should be no UI changes - the goal is to remove the backrefs with no changes to the UI.  There are a few API changes.\r\n\r\nFor some reason, removing the backrefs necessitates reloading the registration and fork during creation.  \r\n"},"comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments/187840764","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4950#issuecomment-187840764","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4950","id":187840764,"user":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T18:55:35Z","updated_at":"2016-02-23T18:55:35Z","body":"Pass complete, no bugs found. :star: \r\n\r\nDid some light manual testing, will do more and a migration on a messier DB after above notes have been addressed."}}