create or replace function add_in_group_versions( current_id_gp int8, link_code text)--current_id_gp int8, RETURNS void LANGUAGE plpgsql AS $function$ declare ver_id int8; begin select v.id from change_request."version" v join gp_project gp on gp.version_id= v.id where v.version_is_actual and gp.code in ($2) into ver_id; insert into change_request.group_versions (group_id, version_id) select distinct gv2.group_id , ver_id from change_request.group_versions gv join change_request.group_versions gv2 on gv2.group_id = gv.group_id join change_request."groups" g on g.id = gv2.group_id join gp_project gp on gp.version_id =g.version_id where gp.id = $1 on conflict do nothing; END; $function$ ;
### Link to the project's wiki page: [Link to the wiki page](https://github.com/Git