Skip to content

Commit f953ae3

Browse files
devin515hexiangyu
and
hexiangyu
authored
Optimized the argument table like database.table for gen:model which can be used to generate another database models. (#7044)
Co-authored-by: hexiangyu <[email protected]>
1 parent ec2273d commit f953ae3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Schema/PostgresBuilder.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,16 @@ public function getColumnListing($table): array
216216

217217
/**
218218
* Get the column type listing for a given table.
219-
*
220-
* @param string $table
221-
* @return array
222219
*/
223-
public function getColumnTypeListing($table)
220+
public function getColumnTypeListing(string $table, ?string $database = null): array
224221
{
225222
[$schema, $table] = $this->parseSchemaAndTable($table);
226223

227224
$table = $this->connection->getTablePrefix() . $table;
228225

229226
$results = $this->connection->select(
230227
$this->grammar->compileColumnListing(),
231-
[$this->connection->getDatabaseName(), $schema, $table]
228+
[$database ?? $this->connection->getDatabaseName(), $schema, $table]
232229
);
233230

234231
/** @var PostgresProcessor $processor */

0 commit comments

Comments
 (0)