Update README with detailed instructions on how to load survey response data

pull/1/head
Alex Basson 4 years ago
parent c36dfe8b5b
commit 8e0af1f17f

@ -81,21 +81,36 @@ None yet
Bootstrap 5 Bootstrap 5
## Loading Data ## Loading Data
SurveyItemResponses is the most important table to understand. SurveyItemResponses is the most important table to understand. SurveyItemResponses is the data that will change year to year and makes up the majority of the database records. Roughly 500,000 SurveyItemResponses per year.
SurveyItemResponses is the data that will change year to year and makes up the majority of the database records. Roughly 150,000 SurveyItemResponses per year. Some notes:
- The data loading task assumes that the CSV files live in the `#{RAILS_ROOT}/data/survey_responses` directory
- The data loading task is idempotent, i.e. it can be run multiple times without duplicating previously-ingested data
How to run the data loading task:
```bash ```bash
# locally # locally
bundle exec rake data:load_survey_responses $ bundle exec rake data:load_survey_responses
# on heroku staging environment # on heroku staging environment
heroku run -a mciea-beta rake data:load_survey_responses $ heroku run:detached -a mciea-beta bundle exec rake data:load_survey_responses
# on heroku production environment # on heroku production environment
heroku run -a mciea-dashboard rake data:load_survey_responses $ heroku run:detached -a mciea-dashboard bundle rake data:load_survey_responses
``` ```
For convenience, you can use the following script for loading data on Heroku:
```bash
# on heroku staging environment
$ ./scripts/load_survey_responses_on_heroku beta
# on heroku production environment
$ ./scripts/load_survey_responses_on_heroku dashboard
```
## Running tests ## Running tests
Prepare the test database. Prepare the test database.

Loading…
Cancel
Save