Skip to content

Commit 9764361

Browse files
update
1 parent a6e266e commit 9764361

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Connectors/MysqlConnector.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ public function describeColumn(Builder $query)
9595

9696
$columnName = 'id';
9797
foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $column) {
98-
if ($column['Key'] === 'PRI') {
99-
$columnName = $column['Field'];
98+
// convert key case
99+
$column = Str::convertArrayCase($column);
100+
101+
if ($column['key'] ?? null === 'PRI') {
102+
$columnName = $column['field'] ?? null;
100103
break;
101104
}
102105
}

src/Schema/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,10 @@ public function doesntExist()
13211321
*/
13221322
public function toSql()
13231323
{
1324+
if(!empty($this->query)){
1325+
return $this->query;
1326+
}
1327+
13241328
$this->applyBeforeQueryCallbacks();
13251329

13261330
return $this->compile()->compileSelect($this);

0 commit comments

Comments
 (0)