Skip to content

Commit

Permalink
Merge pull request #16 from Glacier-Ice/add-db-doc
Browse files Browse the repository at this point in the history
add database instructions
  • Loading branch information
zhaofeng-shu33 committed Mar 17, 2020
2 parents 6b36f9f + 0c09cea commit 5d66b03
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion db/README.md
@@ -1,3 +1,21 @@
We recommend to use postgres docker to run the database server:
```
docker pull postgres:10
docker run -it --rm -v $PWD:/data -e POSTGRES_PASSWORD=abc -p 5432:5432 postgres:10
```
Then in another shell terminal, use `psql -h 127.0.0.1 -p 5432 -U postgres` to
connect to the server. Then
```
create database data;
\c data;
\i area_city.sql;
\i area_province.sql;
\i area_relation.sql;
\i data/area_city_data.sql;
\i data/area_province_data.sql;
```
Thus the database schema is successfully intialized.

epidemic是go写的存储疫情数据代码,后面考虑用python改一下。现使用了两张表,详细如下:

省级表:area_province
Expand Down Expand Up @@ -27,4 +45,3 @@ epidemic是go写的存储疫情数据代码,后面考虑用python改一下。
| cured_count | bigint | 治愈数 |
| dead_count | bigint | 死亡数 |
| suspected_count | bigint | 疑似数 |

0 comments on commit 5d66b03

Please sign in to comment.