create table test.table1
(
    id uuid not null
        primary key
);

create table test.table2
(
    id     uuid not null
        primary key,
    ref_id uuid
        references table1
);