Skip to content

Commit

Permalink
fix db:show with counts option
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezdivandari committed Aug 15, 2024
1 parent 0b85e15 commit b21cbef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Illuminate/Database/Console/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ protected function tables(ConnectionInterface $connection, Builder $schema)
'table' => $table['name'],
'schema' => $table['schema'],
'size' => $table['size'],
'rows' => $this->option('counts') ? $connection->table($table['name'])->count() : null,
'rows' => $this->option('counts')
? $connection->table($table['schema'] ? $table['schema'].'.'.$table['name'] : $table['name'])->count()
: null,
'engine' => $table['engine'],
'collation' => $table['collation'],
'comment' => $table['comment'],
Expand All @@ -100,7 +102,8 @@ protected function views(ConnectionInterface $connection, Builder $schema)
->map(fn ($view) => [
'view' => $view['name'],
'schema' => $view['schema'],
'rows' => $connection->table($view->getName())->count(),
'rows' => $connection->table($view['schema'] ? $view['schema'].'.'.$view['name'] : $view['name'])->count(),

]);
}

Expand Down

0 comments on commit b21cbef

Please sign in to comment.