Skip to content

Commit 0fa5714

Browse files
committed
-
1 parent b51aeff commit 0fa5714

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Schema/Builder.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,20 @@ public function getColumns($table)
187187
foreach ($stats as $stat) {
188188
sort($stat->types);
189189
$type = implode(', ', $stat->types);
190+
$name = $stat->_id;
191+
if ($name === '_id') {
192+
$name = 'id';
193+
}
190194
$columns[] = [
191-
'name' => $stat->_id,
195+
'name' => $name,
192196
'type_name' => $type,
193197
'type' => $type,
194198
'collation' => null,
195-
'nullable' => $stat->_id !== '_id',
199+
'nullable' => $name !== 'id',
196200
'default' => null,
197201
'auto_increment' => false,
198202
'comment' => sprintf('%d occurrences', $stat->total),
199-
'generation' => $stat->_id === '_id' ? ['type' => 'objectId', 'expression' => null] : null,
203+
'generation' => $name === 'id' ? ['type' => 'objectId', 'expression' => null] : null,
200204
];
201205
}
202206

0 commit comments

Comments
 (0)