cofacts / rumors-db

Scripts for managing rumors db
https://g0v.hackmd.io/@mrorz/S1caurZq8
MIT License
6 stars 11 forks source link

Update seed script to use a static set of seed data #2

Closed MrOrz closed 7 years ago

MrOrz commented 7 years ago

Currently inside /data we use CSV files directly downloaded from Airtable.

In very soon we are going to ditch Airtable and allow users to edit the rumor database (ElasticSearch). Therefore, we will no longer update our seed data using CSVs from Airtable.

We can provide a CSV file that already has duplicated answers and rumors removed.

In this issue, we need to:

  1. Populate rumor ID and answer ID in the CSV file. Add answerIds column to rumors in the CSV file so that we don't need to calculate the dependency in the seed script.
  2. Clean up CSV files so that in contains no duplicated rumors and answers. Use answerIds to keep track of the many-to-many relationship among the rumors and answers.
  3. Since IDs and relationship data will be ready in the CSV, we no longer need to calculate them in script/csvToElasticSearch.js. They should be removed.
MrOrz commented 7 years ago

Fixed by 8390fe7c6ddcb907cd8fe51934211f453fce6281