blob: 247c9eb7c1cfe9432e3cd16c912449a7a5bc5af8 [file] [log] [blame]
Sergiusz Bazanski1fad2e52019-08-01 20:16:27 +02001CREATE TABLE peer_checks (
2 peer_id UUID NOT NULL,
3 id UUID DEFAULT gen_random_uuid(),
4
5 check_name STRING NOT NULL,
6 check_time INT NOT NULL,
7 check_status STRING check (
8 check_status = 'unknown' or
9 check_status = 'okay' or
10 check_status = 'failed'
11 ) NOT NULL,
12 check_message STRING NOT NULL,
13 delete BOOL NOT NULL,
14
15 UNIQUE(peer_id, check_name),
16 PRIMARY KEY (peer_id, id),
17 CONSTRAINT fk_peer FOREIGN KEY (peer_id) REFERENCES peers (id) ON DELETE CASCADE
18) INTERLEAVE IN PARENT peers (peer_id);