Skip to content

Commit 7cb8ab8

Browse files
committed
Modify variable name
1 parent edbd140 commit 7cb8ab8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/migrations/MysqlMigrationBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function setColumnsPositions()
256256
return;
257257
}
258258

259-
$takenIndices = $redundantIndices = []; # $redundantIndices are the unwanted ones which are created by moving of one or more columns. Example: if a column is moved from 2nd to 8th position then we will consider only one column is moved ignoring index/position change(-1) of 4rd to 8th column (4->3, 5->4 ...). So migration for this unwanted indices changes won't be generated
259+
$takenIndices = $nonRedundantIndices = []; # $nonRedundantIndices are the wanted ones which are created by moving of one or more columns. Example: if a column is moved from 2nd to 8th position then we will consider only one column is moved ignoring index/position change(-1) of 4rd to 8th column (4->3, 5->4 ...). So migration for this unwanted indices changes won't be generated. `$takenIndices` might have redundant indices
260260
foreach ($this->newColumns as $column) {
261261
/** @var \cebe\yii2openapi\db\ColumnSchema $column */
262262

@@ -280,7 +280,7 @@ public function setColumnsPositions()
280280
if (($column->fromPosition['before'] !== $column->toPosition['before']) &&
281281
($column->fromPosition['after'] !== $column->toPosition['after'])
282282
) {
283-
$redundantIndices[] = [$column->fromPosition['index'], $column->toPosition['index']];
283+
$nonRedundantIndices[] = [$column->fromPosition['index'], $column->toPosition['index']];
284284
}
285285
}
286286

@@ -290,7 +290,7 @@ public function setColumnsPositions()
290290
if (!isset($column->toPosition['index'], $column->fromPosition['index'])) {
291291
continue;
292292
}
293-
$condition = (abs($column->toPosition['index'] - $column->fromPosition['index']) === count($redundantIndices));
293+
$condition = (abs($column->toPosition['index'] - $column->fromPosition['index']) === count($nonRedundantIndices));
294294
if (($column->fromPosition['before'] === $column->toPosition['before'])
295295
&& $condition
296296
) {

0 commit comments

Comments
 (0)