Sergiusz Bazanski | 1fad2e5 | 2019-08-01 20:16:27 +0200 | [diff] [blame] | 1 | CREATE 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); |