Skip to content

Commit

Permalink
fix: don't insert if already was fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Jan 15, 2025
1 parent 96613e0 commit 23bc6a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Migration/Version11000Date20250114182030.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'];
Expand Down

0 comments on commit 23bc6a5

Please sign in to comment.