Skip to content

Commit

Permalink
Fix index sub parts
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Dec 25, 2024
1 parent a8f958d commit d4c2365
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Schema/Ddl/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,23 @@ public function columns(array $columns): static

foreach ($columns as $key => $column) {
if (!$column instanceof Column) {
$colName = $column;

if (is_array($column)) {
$column = $key;
$colName = $key;
}

[$colName, $subParts] = DataType::extract($column);
[$colName, $subParts] = DataType::extract($colName);

$erratas = $column['erratas'] ?? [];

$column = new Column($colName);

if ($subParts) {
$column->erratas(
[
'sub_parts' => $subParts,
]
);
$erratas['sub_parts'] = $subParts;
}

$column->erratas($erratas);
}

$cols[$column->getColumnName()] = $column;
Expand Down

0 comments on commit d4c2365

Please sign in to comment.