-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go back to modeled coverage migration
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
CREATE TYPE signal_level AS ENUM ( | ||
'none', | ||
'low', | ||
'medium', | ||
'high' | ||
); | ||
|
||
CREATE TABLE hex_coverage ( | ||
uuid UUID NOT NULL, | ||
hex BIGINT NOT NULL, | ||
indoor BOOLEAN NOT NULL, | ||
cbsd_id TEXT NOT NULL, | ||
signal_level signal_level NOT NULL, | ||
coverage_claim_time TIMESTAMPTZ NOT NULL, | ||
inserted_at TIMESTAMPTZ NOT NULL, | ||
PRIMARY KEY (uuid, hex) | ||
); | ||
|
||
CREATE TABLE seniority ( | ||
cbsd_id TEXT NOT NULL, | ||
seniority_ts TIMESTAMPTZ NOT NULL, | ||
last_heartbeat TIMESTAMPTZ NOT NULL, | ||
uuid UUID NOT NULL, | ||
PRIMARY KEY (cbsd_id, seniority_ts) | ||
); | ||
|
||
-- Coverage object can be NULL | ||
ALTER TABLE heartbeats ADD COLUMN coverage_object UUID; |