{"action":"closed","number":84,"pull_request":{"url":"https://api.github.com/repos/political-memory/political_memory/pulls/84","id":72458368,"html_url":"https://github.com/political-memory/political_memory/pull/84","diff_url":"https://github.com/political-memory/political_memory/pull/84.diff","patch_url":"https://github.com/political-memory/political_memory/pull/84.patch","issue_url":"https://api.github.com/repos/political-memory/political_memory/issues/84","number":84,"state":"closed","locked":false,"title":"Add import scripts for old data, fixes #58","user":{"login":"njoyard","id":127842,"avatar_url":"https://avatars.githubusercontent.com/u/127842?v=3","gravatar_id":"","url":"https://api.github.com/users/njoyard","html_url":"https://github.com/njoyard","followers_url":"https://api.github.com/users/njoyard/followers","following_url":"https://api.github.com/users/njoyard/following{/other_user}","gists_url":"https://api.github.com/users/njoyard/gists{/gist_id}","starred_url":"https://api.github.com/users/njoyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njoyard/subscriptions","organizations_url":"https://api.github.com/users/njoyard/orgs","repos_url":"https://api.github.com/users/njoyard/repos","events_url":"https://api.github.com/users/njoyard/events{/privacy}","received_events_url":"https://api.github.com/users/njoyard/received_events","type":"User","site_admin":false},"body":"This PR adds two import scripts for old memopol data.\r\n\r\nLinks to exported data:\r\n* [recommendations.csv](https://framabin.org/?ad32ff1675bd62b5#74mkMfNTLRNT4f4tGkJpgxUmRe02Zgp5ImosoBrSAvg=)\r\n* [positions.csv](https://framabin.org/?089bceff87c480cc#EfiUTwUi/Umz6JuqGaPOhwTKpHesnqVdQ8u2CsUVcs0=)\r\n\r\n#### Recommendations\r\n\r\nExport old recommendation data to a `|`-separated CSV file with the following query:\r\n```sql\r\nSELECT CONCAT(r.description, '|', r.weight, '|', r.recommendation, '|',\r\n    r.part, '|', p.title, '|', p.ponderation)\r\nFROM votes_recommendation r\r\n    LEFT JOIN votes_proposal p ON r.proposal_id = p.id\r\nWHERE p.institution = 'EU'\r\n```\r\n\r\nThen run the import script using :\r\n```sh\r\ncat recommendations.csv | memopol_import_recommendations\r\n```\r\n\r\n#### Positions\r\n\r\nExport old position data to a `|`-separated CSV file with the following query:\r\n```sql\r\nSELECT CONCAT(o.content, '|', o.url, '|', o.title, '|', ro.date, '|',\r\n    r.first_name, '|', r.last_name)\r\nFROM reps_opinion o\r\nINNER JOIN reps_opinionrep ro ON ro.opinion_id = o.id\r\nINNER JOIN reps_representative r ON r.id = ro.representative_id\r\nWHERE o.institution='EU'\r\n```\r\n\r\nThen run the import script using :\r\n```sh\r\ncat positions.csv | memopol_import_positions\r\n```","created_at":"2016-06-03T06:10:30Z","updated_at":"2016-06-03T06:17:14Z","closed_at":"2016-06-03T06:17:14Z","merged_at":"2016-06-03T06:17:14Z","merge_commit_sha":"bd8f1bb60778819fc44a6eab7e38cec1fd9c085c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/political-memory/political_memory/pulls/84/commits","review_comments_url":"https://api.github.com/repos/political-memory/political_memory/pulls/84/comments","review_comment_url":"https://api.github.com/repos/political-memory/political_memory/pulls/comments{/number}","comments_url":"https://api.github.com/repos/political-memory/political_memory/issues/84/comments","statuses_url":"https://api.github.com/repos/political-memory/political_memory/statuses/24e97fe5940ca2ef95f24ddeba1d0d0eba8591fa","head":{"label":"political-memory:import-old-data","ref":"import-old-data","sha":"24e97fe5940ca2ef95f24ddeba1d0d0eba8591fa","user":{"login":"political-memory","id":5863689,"avatar_url":"https://avatars.githubusercontent.com/u/5863689?v=3","gravatar_id":"","url":"https://api.github.com/users/political-memory","html_url":"https://github.com/political-memory","followers_url":"https://api.github.com/users/political-memory/followers","following_url":"https://api.github.com/users/political-memory/following{/other_user}","gists_url":"https://api.github.com/users/political-memory/gists{/gist_id}","starred_url":"https://api.github.com/users/political-memory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/political-memory/subscriptions","organizations_url":"https://api.github.com/users/political-memory/orgs","repos_url":"https://api.github.com/users/political-memory/repos","events_url":"https://api.github.com/users/political-memory/events{/privacy}","received_events_url":"https://api.github.com/users/political-memory/received_events","type":"Organization","site_admin":false},"repo":{"id":12538655,"name":"political_memory","full_name":"political-memory/political_memory","owner":{"login":"political-memory","id":5863689,"avatar_url":"https://avatars.githubusercontent.com/u/5863689?v=3","gravatar_id":"","url":"https://api.github.com/users/political-memory","html_url":"https://github.com/political-memory","followers_url":"https://api.github.com/users/political-memory/followers","following_url":"https://api.github.com/users/political-memory/following{/other_user}","gists_url":"https://api.github.com/users/political-memory/gists{/gist_id}","starred_url":"https://api.github.com/users/political-memory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/political-memory/subscriptions","organizations_url":"https://api.github.com/users/political-memory/orgs","repos_url":"https://api.github.com/users/political-memory/repos","events_url":"https://api.github.com/users/political-memory/events{/privacy}","received_events_url":"https://api.github.com/users/political-memory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/political-memory/political_memory","description":"Life is too short, let's patch politic","fork":false,"url":"https://api.github.com/repos/political-memory/political_memory","forks_url":"https://api.github.com/repos/political-memory/political_memory/forks","keys_url":"https://api.github.com/repos/political-memory/political_memory/keys{/key_id}","collaborators_url":"https://api.github.com/repos/political-memory/political_memory/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/political-memory/political_memory/teams","hooks_url":"https://api.github.com/repos/political-memory/political_memory/hooks","issue_events_url":"https://api.github.com/repos/political-memory/political_memory/issues/events{/number}","events_url":"https://api.github.com/repos/political-memory/political_memory/events","assignees_url":"https://api.github.com/repos/political-memory/political_memory/assignees{/user}","branches_url":"https://api.github.com/repos/political-memory/political_memory/branches{/branch}","tags_url":"https://api.github.com/repos/political-memory/political_memory/tags","blobs_url":"https://api.github.com/repos/political-memory/political_memory/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/political-memory/political_memory/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/political-memory/political_memory/git/refs{/sha}","trees_url":"https://api.github.com/repos/political-memory/political_memory/git/trees{/sha}","statuses_url":"https://api.github.com/repos/political-memory/political_memory/statuses/{sha}","languages_url":"https://api.github.com/repos/political-memory/political_memory/languages","stargazers_url":"https://api.github.com/repos/political-memory/political_memory/stargazers","contributors_url":"https://api.github.com/repos/political-memory/political_memory/contributors","subscribers_url":"https://api.github.com/repos/political-memory/political_memory/subscribers","subscription_url":"https://api.github.com/repos/political-memory/political_memory/subscription","commits_url":"https://api.github.com/repos/political-memory/political_memory/commits{/sha}","git_commits_url":"https://api.github.com/repos/political-memory/political_memory/git/commits{/sha}","comments_url":"https://api.github.com/repos/political-memory/political_memory/comments{/number}","issue_comment_url":"https://api.github.com/repos/political-memory/political_memory/issues/comments{/number}","contents_url":"https://api.github.com/repos/political-memory/political_memory/contents/{+path}","compare_url":"https://api.github.com/repos/political-memory/political_memory/compare/{base}...{head}","merges_url":"https://api.github.com/repos/political-memory/political_memory/merges","archive_url":"https://api.github.com/repos/political-memory/political_memory/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/political-memory/political_memory/downloads","issues_url":"https://api.github.com/repos/political-memory/political_memory/issues{/number}","pulls_url":"https://api.github.com/repos/political-memory/political_memory/pulls{/number}","milestones_url":"https://api.github.com/repos/political-memory/political_memory/milestones{/number}","notifications_url":"https://api.github.com/repos/political-memory/political_memory/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/political-memory/political_memory/labels{/name}","releases_url":"https://api.github.com/repos/political-memory/political_memory/releases{/id}","deployments_url":"https://api.github.com/repos/political-memory/political_memory/deployments","created_at":"2013-09-02T11:37:01Z","updated_at":"2016-05-21T01:45:23Z","pushed_at":"2016-06-03T06:17:14Z","git_url":"git://github.com/political-memory/political_memory.git","ssh_url":"git@github.com:political-memory/political_memory.git","clone_url":"https://github.com/political-memory/political_memory.git","svn_url":"https://github.com/political-memory/political_memory","homepage":null,"size":11317,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":23,"forks":5,"open_issues":23,"watchers":6,"default_branch":"master"}},"base":{"label":"political-memory:master","ref":"master","sha":"eeb3b2206f05c14c8c59a942eb373dd841a99049","user":{"login":"political-memory","id":5863689,"avatar_url":"https://avatars.githubusercontent.com/u/5863689?v=3","gravatar_id":"","url":"https://api.github.com/users/political-memory","html_url":"https://github.com/political-memory","followers_url":"https://api.github.com/users/political-memory/followers","following_url":"https://api.github.com/users/political-memory/following{/other_user}","gists_url":"https://api.github.com/users/political-memory/gists{/gist_id}","starred_url":"https://api.github.com/users/political-memory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/political-memory/subscriptions","organizations_url":"https://api.github.com/users/political-memory/orgs","repos_url":"https://api.github.com/users/political-memory/repos","events_url":"https://api.github.com/users/political-memory/events{/privacy}","received_events_url":"https://api.github.com/users/political-memory/received_events","type":"Organization","site_admin":false},"repo":{"id":12538655,"name":"political_memory","full_name":"political-memory/political_memory","owner":{"login":"political-memory","id":5863689,"avatar_url":"https://avatars.githubusercontent.com/u/5863689?v=3","gravatar_id":"","url":"https://api.github.com/users/political-memory","html_url":"https://github.com/political-memory","followers_url":"https://api.github.com/users/political-memory/followers","following_url":"https://api.github.com/users/political-memory/following{/other_user}","gists_url":"https://api.github.com/users/political-memory/gists{/gist_id}","starred_url":"https://api.github.com/users/political-memory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/political-memory/subscriptions","organizations_url":"https://api.github.com/users/political-memory/orgs","repos_url":"https://api.github.com/users/political-memory/repos","events_url":"https://api.github.com/users/political-memory/events{/privacy}","received_events_url":"https://api.github.com/users/political-memory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/political-memory/political_memory","description":"Life is too short, let's patch politic","fork":false,"url":"https://api.github.com/repos/political-memory/political_memory","forks_url":"https://api.github.com/repos/political-memory/political_memory/forks","keys_url":"https://api.github.com/repos/political-memory/political_memory/keys{/key_id}","collaborators_url":"https://api.github.com/repos/political-memory/political_memory/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/political-memory/political_memory/teams","hooks_url":"https://api.github.com/repos/political-memory/political_memory/hooks","issue_events_url":"https://api.github.com/repos/political-memory/political_memory/issues/events{/number}","events_url":"https://api.github.com/repos/political-memory/political_memory/events","assignees_url":"https://api.github.com/repos/political-memory/political_memory/assignees{/user}","branches_url":"https://api.github.com/repos/political-memory/political_memory/branches{/branch}","tags_url":"https://api.github.com/repos/political-memory/political_memory/tags","blobs_url":"https://api.github.com/repos/political-memory/political_memory/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/political-memory/political_memory/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/political-memory/political_memory/git/refs{/sha}","trees_url":"https://api.github.com/repos/political-memory/political_memory/git/trees{/sha}","statuses_url":"https://api.github.com/repos/political-memory/political_memory/statuses/{sha}","languages_url":"https://api.github.com/repos/political-memory/political_memory/languages","stargazers_url":"https://api.github.com/repos/political-memory/political_memory/stargazers","contributors_url":"https://api.github.com/repos/political-memory/political_memory/contributors","subscribers_url":"https://api.github.com/repos/political-memory/political_memory/subscribers","subscription_url":"https://api.github.com/repos/political-memory/political_memory/subscription","commits_url":"https://api.github.com/repos/political-memory/political_memory/commits{/sha}","git_commits_url":"https://api.github.com/repos/political-memory/political_memory/git/commits{/sha}","comments_url":"https://api.github.com/repos/political-memory/political_memory/comments{/number}","issue_comment_url":"https://api.github.com/repos/political-memory/political_memory/issues/comments{/number}","contents_url":"https://api.github.com/repos/political-memory/political_memory/contents/{+path}","compare_url":"https://api.github.com/repos/political-memory/political_memory/compare/{base}...{head}","merges_url":"https://api.github.com/repos/political-memory/political_memory/merges","archive_url":"https://api.github.com/repos/political-memory/political_memory/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/political-memory/political_memory/downloads","issues_url":"https://api.github.com/repos/political-memory/political_memory/issues{/number}","pulls_url":"https://api.github.com/repos/political-memory/political_memory/pulls{/number}","milestones_url":"https://api.github.com/repos/political-memory/political_memory/milestones{/number}","notifications_url":"https://api.github.com/repos/political-memory/political_memory/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/political-memory/political_memory/labels{/name}","releases_url":"https://api.github.com/repos/political-memory/political_memory/releases{/id}","deployments_url":"https://api.github.com/repos/political-memory/political_memory/deployments","created_at":"2013-09-02T11:37:01Z","updated_at":"2016-05-21T01:45:23Z","pushed_at":"2016-06-03T06:17:14Z","git_url":"git://github.com/political-memory/political_memory.git","ssh_url":"git@github.com:political-memory/political_memory.git","clone_url":"https://github.com/political-memory/political_memory.git","svn_url":"https://github.com/political-memory/political_memory","homepage":null,"size":11317,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":23,"forks":5,"open_issues":23,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/political-memory/political_memory/pulls/84"},"html":{"href":"https://github.com/political-memory/political_memory/pull/84"},"issue":{"href":"https://api.github.com/repos/political-memory/political_memory/issues/84"},"comments":{"href":"https://api.github.com/repos/political-memory/political_memory/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/political-memory/political_memory/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/political-memory/political_memory/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/political-memory/political_memory/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/political-memory/political_memory/statuses/24e97fe5940ca2ef95f24ddeba1d0d0eba8591fa"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"njoyard","id":127842,"avatar_url":"https://avatars.githubusercontent.com/u/127842?v=3","gravatar_id":"","url":"https://api.github.com/users/njoyard","html_url":"https://github.com/njoyard","followers_url":"https://api.github.com/users/njoyard/followers","following_url":"https://api.github.com/users/njoyard/following{/other_user}","gists_url":"https://api.github.com/users/njoyard/gists{/gist_id}","starred_url":"https://api.github.com/users/njoyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njoyard/subscriptions","organizations_url":"https://api.github.com/users/njoyard/orgs","repos_url":"https://api.github.com/users/njoyard/repos","events_url":"https://api.github.com/users/njoyard/events{/privacy}","received_events_url":"https://api.github.com/users/njoyard/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":9,"additions":309,"deletions":2,"changed_files":10}}
{"actor":{"display_login":"njoyard"}}