Part of my SQL definition (for hsqldb):
CREATE TABLE activities (
id BIGINT GENERATED BY DEFAULT AS IDENTITY,
group_id BIGINT NOT NULL
CONSTRAINT pk_activities PRIMARY KEY (id)
);
The scenario during and insert
is:
id
is auto generated / auto-incremented,group_id
when specified (non-null) is set to the given value,group_id
when not specified is set to the value ofid
just generated
I target postgresql and hsqldb (for tests).
Can this be done?