Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
COVID-19-Data-Integration
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ivy Wang
COVID-19-Data-Integration
Commits
c7c1b37c
Commit
c7c1b37c
authored
3 years ago
by
Ivy Wang
Browse files
Options
Downloads
Patches
Plain Diff
merge
parent
47b8505c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
daily_data_scripts/daily_asia.py
+2
-0
2 additions, 0 deletions
daily_data_scripts/daily_asia.py
data/OverallSchema.sql
+21
-21
21 additions, 21 deletions
data/OverallSchema.sql
prototype_main_backend.py
+21
-21
21 additions, 21 deletions
prototype_main_backend.py
with
44 additions
and
42 deletions
daily_data_scripts/daily_asia.py
+
2
−
0
View file @
c7c1b37c
...
...
@@ -23,6 +23,8 @@ def string_to_int(s):
def
update_korea
():
conn
=
sqlite3
.
connect
(
'
prototype_db
'
)
c
=
conn
.
cursor
()
korea_code
=
get_country_code
(
"
Korea, Republic of
"
,
c
)
korea_src_url
=
"
http://ncov.mohw.go.kr/index.jsp
"
korea_src
=
get_source_id
(
korea_src_url
,
c
)
...
...
This diff is collapsed.
Click to expand it.
data/OverallSchema.sql
+
21
−
21
View file @
c7c1b37c
...
...
@@ -80,9 +80,9 @@ CREATE TABLE Cases_Per_District(
-- keeps track of vaccinations per Country
CREATE
TABLE
Vaccinations_Per_Country
(
first_vaccination_number
BIGINT
NOT
NULL
,
second_vaccination_number
BIGINT
NOT
NULL
,
third_vaccination_number
BIGINT
NOT
NULL
,
first_vaccination_number
BIGINT
NULL
,
second_vaccination_number
BIGINT
NULL
,
third_vaccination_number
BIGINT
NULL
,
country_code
VARCHAR
(
2
)
,
source_id
BIGINT
NOT
NULL
,
FOREIGN
KEY
(
country_code
)
REFERENCES
Countries
(
country_code
),
...
...
@@ -91,9 +91,9 @@ CREATE TABLE Vaccinations_Per_Country(
-- keeps track of vaccinations per Region
CREATE
TABLE
Vaccinations_Per_Region
(
first_vaccination_number
BIGINT
NOT
NULL
,
second_vaccination_number
BIGINT
NOT
NULL
,
third_vaccination_number
BIGINT
NOT
NULL
,
first_vaccination_number
BIGINT
NULL
,
second_vaccination_number
BIGINT
NULL
,
third_vaccination_number
BIGINT
NULL
,
region_code
BIGINT
,
source_id
BIGINT
NOT
NULL
,
FOREIGN
KEY
(
region_code
)
REFERENCES
Regions
(
region_code
),
...
...
@@ -102,9 +102,9 @@ CREATE TABLE Vaccinations_Per_Region(
-- keeps track of vaccinations per District
CREATE
TABLE
Vaccinations_Per_District
(
first_vaccination_number
BIGINT
NOT
NULL
,
second_vaccination_number
BIGINT
NOT
NULL
,
third_vaccination_number
BIGINT
NOT
NULL
,
first_vaccination_number
BIGINT
NULL
,
second_vaccination_number
BIGINT
NULL
,
third_vaccination_number
BIGINT
NULL
,
district_code
BIGINT
,
source_id
BIGINT
NOT
NULL
,
FOREIGN
KEY
(
district_code
)
REFERENCES
Districts
(
district_code
),
...
...
@@ -160,10 +160,10 @@ CREATE TABLE Age_Per_Country(
recovery_number
INT
NULL
,
hospitalization_number
INT
NULL
,
death_number
INT
NULL
,
case_rate
IN
T
NULL
,
recovery_rate
IN
T
NULL
,
hospitalization_rate
IN
T
NULL
,
death_rate
IN
T
NULL
,
case_rate
FLOA
T
NULL
,
recovery_rate
FLOA
T
NULL
,
hospitalization_rate
FLOA
T
NULL
,
death_rate
FLOA
T
NULL
,
FOREIGN
KEY
(
country_id
)
REFERENCES
Countries
(
country_code
),
FOREIGN
KEY
(
source_id
)
REFERENCES
Sources
(
source_id
)
);
...
...
@@ -178,10 +178,10 @@ CREATE TABLE Age_Per_Region(
recovery_number
INT
NULL
,
hospitalization_number
INT
NULL
,
death_number
INT
NULL
,
case_rate
IN
T
NULL
,
recovery_rate
IN
T
NULL
,
hospitalization_rate
IN
T
NULL
,
death_rate
IN
T
NULL
,
case_rate
FLOA
T
NULL
,
recovery_rate
FLOA
T
NULL
,
hospitalization_rate
FLOA
T
NULL
,
death_rate
FLOA
T
NULL
,
FOREIGN
KEY
(
region_id
)
REFERENCES
Regions
(
region_code
),
FOREIGN
KEY
(
source_id
)
REFERENCES
Sources
(
source_id
)
);
...
...
@@ -196,10 +196,10 @@ CREATE TABLE Age_Per_District(
recovery_number
INT
NULL
,
hospitalization_number
INT
NULL
,
death_number
INT
NULL
,
case_rate
IN
T
NULL
,
recovery_rate
IN
T
NULL
,
hospitalization_rate
IN
T
NULL
,
death_rate
IN
T
NULL
,
case_rate
FLOA
T
NULL
,
recovery_rate
FLOA
T
NULL
,
hospitalization_rate
FLOA
T
NULL
,
death_rate
FLOA
T
NULL
,
FOREIGN
KEY
(
district_id
)
REFERENCES
Districts
(
district_code
),
FOREIGN
KEY
(
source_id
)
REFERENCES
Sources
(
source_id
)
);
...
...
This diff is collapsed.
Click to expand it.
prototype_main_backend.py
+
21
−
21
View file @
c7c1b37c
...
...
@@ -84,9 +84,9 @@ c.execute('''
c
.
execute
(
'''
CREATE TABLE Vaccinations_Per_Country(
date_collected DATETIME2 NOT NULL,
first_vaccination_number BIGINT
NOT
NULL,
second_vaccination_number BIGINT
NOT
NULL,
third_vaccination_number BIGINT
NOT
NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
country_code VARCHAR(2),
source_id BIGINT NOT NULL,
FOREIGN KEY (country_code) REFERENCES Countries(country_code),
...
...
@@ -97,9 +97,9 @@ c.execute('''
c
.
execute
(
'''
CREATE TABLE Vaccinations_Per_Region(
date_collected DATETIME2 NOT NULL,
first_vaccination_number BIGINT
NOT
NULL,
second_vaccination_number BIGINT
NOT
NULL,
third_vaccination_number BIGINT
NOT
NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
region_code BIGINT,
source_id BIGINT NOT NULL,
FOREIGN KEY (region_code) REFERENCES Regions(region_code),
...
...
@@ -110,9 +110,9 @@ c.execute('''
c
.
execute
(
'''
CREATE TABLE Vaccinations_Per_District(
date_collected DATETIME2 NOT NULL,
first_vaccination_number BIGINT
NOT
NULL,
second_vaccination_number BIGINT
NOT
NULL,
third_vaccination_number BIGINT
NOT
NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
district_code BIGINT,
source_id BIGINT NOT NULL,
FOREIGN KEY (district_code) REFERENCES Districts(district_code),
...
...
@@ -153,10 +153,10 @@ c.execute('''CREATE TABLE Age_Per_Country(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate
IN
T NULL,
recovery_rate
IN
T NULL,
hospitalization_rate
IN
T NULL,
death_rate
IN
T NULL,
case_rate
FLOA
T NULL,
recovery_rate
FLOA
T NULL,
hospitalization_rate
FLOA
T NULL,
death_rate
FLOA
T NULL,
FOREIGN KEY (country_id) REFERENCES Countries(country_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
...
...
@@ -171,10 +171,10 @@ c.execute('''CREATE TABLE Age_Per_Region(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate
IN
T NULL,
recovery_rate
IN
T NULL,
hospitalization_rate
IN
T NULL,
death_rate
IN
T NULL,
case_rate
FLOA
T NULL,
recovery_rate
FLOA
T NULL,
hospitalization_rate
FLOA
T NULL,
death_rate
FLOA
T NULL,
FOREIGN KEY (region_id) REFERENCES Regions(region_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
...
...
@@ -190,10 +190,10 @@ c.execute('''CREATE TABLE Age_Per_District(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate
IN
T NULL,
recovery_rate
IN
T NULL,
hospitalization_rate
IN
T NULL,
death_rate
IN
T NULL,
case_rate
FLOA
T NULL,
recovery_rate
FLOA
T NULL,
hospitalization_rate
FLOA
T NULL,
death_rate
FLOA
T NULL,
FOREIGN KEY (district_id) REFERENCES Districts(district_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment