Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tamedevelopers committed Feb 26, 2024
1 parent a6e266e commit 9764361
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Connectors/MysqlConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ public function describeColumn(Builder $query)

$columnName = 'id';
foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $column) {
if ($column['Key'] === 'PRI') {
$columnName = $column['Field'];
// convert key case
$column = Str::convertArrayCase($column);

if ($column['key'] ?? null === 'PRI') {
$columnName = $column['field'] ?? null;
break;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,10 @@ public function doesntExist()
*/
public function toSql()
{
if(!empty($this->query)){
return $this->query;
}

$this->applyBeforeQueryCallbacks();

return $this->compile()->compileSelect($this);
Expand Down

0 comments on commit 9764361

Please sign in to comment.