Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions sql/sensors/tracker_motion/create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,18 @@ GRANT ALL PRIVILEGES ON pill_status_id_seq TO ingress_user;

ALTER TABLE pill_status ADD COLUMN uptime BIGINT;
ALTER TABLE pill_status ADD COLUMN fw_version INTEGER;


CREATE TABLE pill_classification (
id BIGSERIAL PRIMARY KEY,
internal_pill_id BIGINT,
pill_id VARCHAR(255),
last_24pt_window_ts TIMESTAMP,
last_72pt_window_ts TIMESTAMP,
last_update_batt INTEGER,
max_24hr_diff INTEGER,
max_72hr_diff INTEGER,
class INTEGER
);
CREATE INDEX pill_battery_monitor_id_status on pill_battery_monitor(internal_pill_id, last_update);
CREATE UNIQUE INDEX pill_battery_monitor_id_unique on pill_battery_monitor(internal_pill_id);
Loading