forked from stripe-archive/pd2pg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
77 lines (67 loc) · 1.58 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
create table incidents (
id varchar primary key,
incident_number int not null,
created_at timestamptz not null,
html_url varchar not null,
incident_key varchar,
service_id varchar,
escalation_policy_id varchar,
trigger_summary_subject varchar,
trigger_summary_description varchar,
trigger_type varchar
);
create table log_entries (
id varchar primary key,
type varchar not null,
created_at timestamptz not null,
incident_id varchar not null,
agent_type varchar,
agent_id varchar,
channel_type varchar,
user_id varchar,
notification_type varchar,
assigned_user_id varchar
);
create table services (
id varchar primary key,
name varchar not null,
status varchar not null,
type varchar not null
);
create table escalation_policies (
id varchar primary key,
name varchar not null,
num_loops int not null
);
create table escalation_rules (
id varchar primary key,
escalation_policy_id varchar not null,
escalation_delay_in_minutes int,
level_index int
);
create table escalation_rule_users (
id varchar primary key,
escalation_rule_id varchar not null,
user_id varchar
);
create table escalation_rule_schedules (
id varchar primary key,
escalation_rule_id varchar not null,
schedule_id varchar
);
create table schedules (
id varchar primary key,
name varchar not null
);
create table users (
id varchar primary key,
name varchar not null,
email varchar not null
);
create table user_schedule (
id varchar primary key,
user_id varchar,
schedule_id varchar
);
-- Extension tablefunc enables crosstabs.
create extension tablefunc;