DROP TABLE api.segments_stream_links; CREATE TABLE api.segments_stream_links ( id int GENERATED ALWAYS AS IDENTITY, stream_id UUID NOT NULL REFERENCES api.streams(id), segment_id INT NOT NULL REFERENCES api.segments(id), capture_job_id text NOT NULL, PRIMARY KEY(id, stream_id, segment_id) );