Skip to content

Commit

Permalink
Go back to modeled coverage migration
Browse files Browse the repository at this point in the history
  • Loading branch information
maplant committed Jul 25, 2023
1 parent cf527c1 commit c37f583
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mobile_verifier/migrations/15_heartbeat_coverage_object.sql

This file was deleted.

28 changes: 28 additions & 0 deletions mobile_verifier/migrations/15_modeled_coverage.sql
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;

0 comments on commit c37f583

Please sign in to comment.