Is there no easy way to do this without sequences and triggers? I have average SQL skills, and I want to use the industry standard method for pl/sql (PostgreSQL). I'm basically converting over this example table from Spring Security:
create table group_members (
id bigint generated by default as identity(start with 0) primary key,
username varchar(50) not null,
group_id bigint not null,
constraint fk_group_members_group foreign key(group_id) references groups(id));
What I have so far:
CREATE TABLE auth_group_members (
id NUMBER,
username VARCHAR(50) NOT NULL,
group_id NUMBER NOT NULL,
CONSTRAINT "FK_AuthGroupMembers" FOREIGN KEY(group_id) REFERENCES auth_groups(id)
);