CREATE TABLE allowed_prefixes (
    peer_id UUID NOT NULL,
    id UUID DEFAULT gen_random_uuid(),
    timestamp INT NOT NULL,

    prefix STRING NOT NULL,
    max_length INT NOT NULL,
    ta STRING NOT NULL,

    PRIMARY KEY (peer_id, id),
    UNIQUE (peer_id, prefix),
    CONSTRAINT fk_peer FOREIGN KEY (peer_id) REFERENCES peers (id) ON DELETE CASCADE
) INTERLEAVE IN PARENT peers (peer_id);
