Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Add type_id to the Alerts table #40

@schnuerle

Description

@schnuerle

I'd like to add a type_id that references the alert_types table. Currently this table is unused. I also think the type and subtype columns should be removed from the alerts table.

-- modify database
ALTER TABLE waze.alerts ADD COLUMN IF NOT EXISTS type_id INTEGER;
CREATE INDEX CONCURRENTLY alerts_type_id_idx ON waze.alerts (type_id);

-- add data to new type_id field in alerts
UPDATE waze.alerts AS a 
SET type_id = t.id
FROM waze.alert_types AS t
WHERE a.type = t.type 
 and a.subtype = t.subtype 
 and a.type_id is null; 

Metadata

Metadata

Assignees

Labels

Help WantedGood items to start with if you are looking to help with the projectIn ProgressCurrently being worked onPhase 1 RDSEnd to end data processor with hooks and alarmsv3.0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions