Skip to content

Commit 32e1a42

Browse files
committed
added copy of new table definition to migration file
1 parent 4e4afa7 commit 32e1a42

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/ddl/migrations/covid_hosp_facility_v0.3-v0.3.1.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
-- table definition copied from ../covid_hosp.sql
2+
CREATE TABLE `covid_hosp_facility_key` (
3+
`id` INT NOT NULL AUTO_INCREMENT,
4+
`address` VARCHAR(128),
5+
`ccn` VARCHAR(20),
6+
`city` VARCHAR(64),
7+
`fips_code` CHAR(5),
8+
`geocoded_hospital_address` VARCHAR(32), -- <--- not currently exposed by endpoint
9+
`hhs_ids` VARCHAR(127), -- <--- not currently exposed by endpoint
10+
`hospital_name` VARCHAR(256),
11+
`hospital_pk` VARCHAR(128) NOT NULL,
12+
`hospital_subtype` VARCHAR(64),
13+
`is_metro_micro` BOOLEAN,
14+
`state` CHAR(2) NOT NULL,
15+
`zip` CHAR(5),
16+
PRIMARY KEY (`id`),
17+
UNIQUE KEY (`hospital_pk`),
18+
-- for fast lookup of hospitals in a given location
19+
KEY (`state`, `hospital_pk`),
20+
KEY (`ccn`, `hospital_pk`),
21+
KEY (`city`, `hospital_pk`),
22+
KEY (`zip`, `hospital_pk`),
23+
KEY (`fips_code`, `hospital_pk`)
24+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
25+
126
INSERT INTO `covid_hosp_facility_key`
227
(`address`,`ccn`,`city`,`fips_code`,`geocoded_hospital_address`,`hhs_ids`,`hospital_name`,`hospital_pk`,`hospital_subtype`,`is_metro_micro`,`state`,`zip`)
328
SELECT

0 commit comments

Comments
 (0)