CREATE TABLE queryConfigs (
    id uuid primary key,
    queryId uuid not null,
    config jsonb not null,
    addedVersion int not null,
    removedVersion int,
    foreign key (queryId) references queries(id),
    unique (queryId, removedVersion)
);