political-memory / political_memory

WARNING: this repository has now moved to https://git.laquadrature.net/memopol/memopol
https://memopol.lqdn.fr/
12 stars 2 forks source link

Add import scripts for old data, fixes #58 #84

Closed njoyard closed 8 years ago

njoyard commented 8 years ago

This PR adds two import scripts for old memopol data.

Links to exported data:

Export old recommendation data to a |-separated CSV file with the following query:

SELECT CONCAT(r.description, '|', r.weight, '|', r.recommendation, '|',
    r.part, '|', p.title, '|', p.ponderation)
FROM votes_recommendation r
    LEFT JOIN votes_proposal p ON r.proposal_id = p.id
WHERE p.institution = 'EU'

Then run the import script using :

cat recommendations.csv | memopol_import_recommendations

Positions

Export old position data to a |-separated CSV file with the following query:

SELECT CONCAT(o.content, '|', o.url, '|', o.title, '|', ro.date, '|',
    r.first_name, '|', r.last_name)
FROM reps_opinion o
INNER JOIN reps_opinionrep ro ON ro.opinion_id = o.id
INNER JOIN reps_representative r ON r.id = ro.representative_id
WHERE o.institution='EU'

Then run the import script using :

cat positions.csv | memopol_import_positions
codecov-io commented 8 years ago

Current coverage is 87.81%

Merging #84 into master will increase coverage by <.01%

@@             master        #84   diff @@
==========================================
  Files            34         34          
  Lines           598        599     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            525        526     +1   
  Misses           73         73          
  Partials          0          0          

Powered by Codecov. Last updated by eeb3b22...24e97fe