blob: c033e3d1c7d322e93c1b5ea7dcf9e33ff56624ca [file] [log] [blame]
Sergiusz Bazanski1fad2e52019-08-01 20:16:27 +02001CREATE TABLE allowed_prefixes (
2 peer_id UUID NOT NULL,
3 id UUID DEFAULT gen_random_uuid(),
4 timestamp INT NOT NULL,
5
6 prefix STRING NOT NULL,
7 max_length INT NOT NULL,
8 ta STRING NOT NULL,
9
10 PRIMARY KEY (peer_id, id),
11 UNIQUE (peer_id, prefix),
12 CONSTRAINT fk_peer FOREIGN KEY (peer_id) REFERENCES peers (id) ON DELETE CASCADE
13) INTERLEAVE IN PARENT peers (peer_id);