create table plans ( plan_id bigint generated by default as identity primary key ); create table items ( item_id bigint generated by default as identity primary key ); create table plan_items ( plan_item_id bigint generated by default as identity primary key, plan_id bigint not null REFERENCES plans, item_id bigint not null REFERENCES items );