From 23bc6a54c38df5e0b245eef2bf16784cb1bddb18 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Wed, 15 Jan 2025 15:11:32 -0300 Subject: [PATCH] fix: don't insert if already was fixed Signed-off-by: Vitor Mattos --- lib/Migration/Version11000Date20250114182030.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Migration/Version11000Date20250114182030.php b/lib/Migration/Version11000Date20250114182030.php index 0aa2ed2dc..4e1728167 100644 --- a/lib/Migration/Version11000Date20250114182030.php +++ b/lib/Migration/Version11000Date20250114182030.php @@ -78,11 +78,13 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $insert1 = $this->connection->getQueryBuilder(); $fixedConstraints = []; $fixedIds = []; + $fixedSignRequestIds = []; foreach ($identifyMethods as $key => $row) { if (!$row['fixed_id'] || $row['id'] > $maxId || in_array($row['id'], $fixedIds)) { continue; } $fixedIds[] = $row['id']; + $fixedSignRequestIds[] = $row['fixed_id']; $constraint = $row['fixed_id'] . ',' . $row['identifier_key'] . ',' . $row['identifier_value']; $fixedConstraints[] = $constraint; $insert1 @@ -106,7 +108,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array // Insert non fixed rows $insertedNonFixed = []; foreach ($identifyMethods as $key => $row) { - if ($row['fixed_id'] || $row['id'] > $maxId || in_array($row['id'], $fixedIds)) { + if ($row['fixed_id'] || $row['id'] > $maxId || in_array($row['id'], $fixedIds) || in_array($row['sign_request_id'], $fixedSignRequestIds)) { continue; } $constraint = $row['sign_request_id'] . ',' . $row['identifier_key'] . ',' . $row['identifier_value'];