Skip to content

Add import scripts for old data, fixes #58

njoyard requested to merge import-old-data-24e97fe5 into master

Created by: njoyard

This PR adds two import scripts for old memopol data.

Links to exported data:

Recommendations

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

Merge request reports