Skip to content

Commit de37a27

Browse files
committed
Fixed the migrations to avoid ONLY_FULL_GROUP_BY error.
1 parent cddc314 commit de37a27

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

migrations/.DS_Store

-6 KB
Binary file not shown.

migrations/db/20200304131105_fix_recommendations_position.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function change()
3636
INNER JOIN `recommandations_risks` rr ON r.`uuid` = rr.`recommandation_id` AND r.`anr_id` = rr.`anr_id`
3737
WHERE r.`anr_id` = ' . $anr['id'] . '
3838
AND r.`importance` > 0
39-
GROUP BY r.`uuid`
39+
GROUP BY r.`uuid`, r.`position`, r.`code`
4040
ORDER BY r.`position`, r.`code`'
4141
);
4242
$position = 1;

migrations/db/20210521090000_changeable_operational_impact.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,20 @@ public function change()
146146
FROM scales s
147147
INNER JOIN scales_comments sc ON sc.scale_id = s.id
148148
LEFT JOIN scales_impact_types sit ON sit.scale_id = s.id AND sit.id = sc.scale_type_impact_id
149-
WHERE s.type = 1 AND sit.type > 3 OR s.type = 2
150-
GROUP BY s.anr_id, s.id, sit.id
149+
WHERE (s.type = 1 AND sit.type > 3) OR s.type = 2
150+
GROUP BY
151+
s.anr_id,
152+
s.id,
153+
s.type,
154+
s.min,
155+
s.max,
156+
sit.id,
157+
sit.label1,
158+
sit.label2,
159+
sit.label3,
160+
sit.label4,
161+
sit.type,
162+
sit.is_hidden
151163
ORDER BY s.anr_id, s.id'
152164
);
153165

0 commit comments

Comments
 (0)