Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Sep 20, 2024
1 parent b51aeff commit 0fa5714
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,20 @@ public function getColumns($table)
foreach ($stats as $stat) {
sort($stat->types);
$type = implode(', ', $stat->types);
$name = $stat->_id;
if ($name === '_id') {
$name = 'id';
}
$columns[] = [
'name' => $stat->_id,
'name' => $name,
'type_name' => $type,
'type' => $type,
'collation' => null,
'nullable' => $stat->_id !== '_id',
'nullable' => $name !== 'id',
'default' => null,
'auto_increment' => false,
'comment' => sprintf('%d occurrences', $stat->total),
'generation' => $stat->_id === '_id' ? ['type' => 'objectId', 'expression' => null] : null,
'generation' => $name === 'id' ? ['type' => 'objectId', 'expression' => null] : null,
];
}

Expand Down

0 comments on commit 0fa5714

Please sign in to comment.