Skip to content
This repository was archived by the owner on Apr 8, 2021. It is now read-only.
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
5 changes: 3 additions & 2 deletions bin/pd2pg
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ class PG2PD

# Send all service records from Pagerduty to database.
def services_to_db(items)
columns = [:id, :name, :status, :type]
columns = [:id, :name, :status, :type, :escalation_id]
records = items.map do |i|
[i['id'],
i['name'],
i['status'],
i['type']]
i['type'],
i['escalation_policy']['id']]
end
database_replace(:services, columns, records)
end
Expand Down
3 changes: 2 additions & 1 deletion schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ create table services (
id varchar primary key,
name varchar not null,
status varchar not null,
type varchar not null
type varchar not null,
escalation_id varchar
);

create table escalation_policies (
Expand Down