Update seed script to use a static set of seed data
MrOrz opened this issue · 1 comments
MrOrz commented
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:
- 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. - 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. - 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.