Merge branch 'fix_duplicate_acp_participation_handler' into 'master'

Use the correct id_seq to explicitly assign id to new row in accompanying...

See merge request Chill-Projet/chill-bundles!644
This commit is contained in:
LenaertsJ 2024-01-11 11:48:41 +00:00
commit 86bf5eba4f
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,6 @@
kind: Fixed
body: Fix the id_seq used when creating a new accompanying period participation during
fusion of two person files
time: 2024-01-11T11:59:09.581242964+01:00
custom:
Issue: ""

View File

@ -26,7 +26,7 @@ class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlH
{ {
$insertSql = sprintf(<<<'SQL' $insertSql = sprintf(<<<'SQL'
INSERT INTO chill_person_accompanying_period_participation (person_id, accompanyingperiod_id, id, startdate, enddate) INSERT INTO chill_person_accompanying_period_participation (person_id, accompanyingperiod_id, id, startdate, enddate)
SELECT %d, accompanyingperiod_id, nextval('chill_person_accompanying_period_id_seq'), startdate, enddate SELECT %d, accompanyingperiod_id, nextval('chill_person_accompanying_period_participation_id_seq'), startdate, enddate
FROM chill_person_accompanying_period_participation cpapp FROM chill_person_accompanying_period_participation cpapp
WHERE person_id = %d WHERE person_id = %d
AND NOT EXISTS ( AND NOT EXISTS (