Writing A Covid-19 Visualization App in Ruby on Rails 6, part 1

The Data

The Requirements

rbenv install 2.6.6
ruby -v
gem install rails -v 6.0.2.2

Create The App

rails _6.0.2.2_ new covid-ontario -d postgresql

Create a Model

rails g model patient_data external_id:integer episode_date:date age_group:string gender:string acquisition_info:string outcome:string reporter:string reporter_address:string reporter_city:string reporter_postal_code:string reporter_website:string reporter_latitude:float reporter_longitude:float country:string region:string
rails g migration addExternalIdIndexToPatientDatum
class AddExternalIdIndexToPatientDatum < ActiveRecord::Migration[6.0]
def change
add_index :patient_data, [:external_id, :country ,:region], unique: true
end
end

Store The Data

rails db:setup
mkdir data
wget https://data.ontario.ca/dataset/f4112442-bdc8-45d2-be3c-12efae72fb27/resource/455fd63b-603d-4608-8216-7d8647f43350/download/conposcovidloc.csv

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store