Skip to content

Commit 30c0175

Browse files
Fixed bug that pdo connector with pgsql cannot work when using migration. (#7377)
Co-authored-by: 李铭昕 <[email protected]>
1 parent 02b2a48 commit 30c0175

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

src/DBAL/PostgresPdoDriver.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file is part of Hyperf.
6+
*
7+
* @link https://www.hyperf.io
8+
* @document https://hyperf.wiki
9+
* @contact [email protected]
10+
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
11+
*/
12+
13+
namespace Hyperf\Database\PgSQL\DBAL;
14+
15+
use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
16+
use Hyperf\Database\DBAL\Concerns\ConnectsToDatabase;
17+
18+
class PostgresPdoDriver extends AbstractPostgreSQLDriver
19+
{
20+
use ConnectsToDatabase;
21+
}

src/PostgreSqlConnection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Hyperf\Database\PgSQL;
1313

1414
use Hyperf\Database\Connection;
15-
use Hyperf\Database\PgSQL\DBAL\PostgresDriver;
15+
use Hyperf\Database\PgSQL\DBAL\PostgresPdoDriver;
1616
use Hyperf\Database\PgSQL\Query\Grammars\PostgresGrammar as QueryGrammar;
1717
use Hyperf\Database\PgSQL\Query\Processors\PostgresProcessor;
1818
use Hyperf\Database\PgSQL\Schema\Grammars\PostgresGrammar as SchemaGrammar;
@@ -76,8 +76,8 @@ protected function getDefaultPostProcessor(): PostgresProcessor
7676
/**
7777
* Get the Doctrine DBAL driver.
7878
*/
79-
protected function getDoctrineDriver(): PostgresDriver
79+
protected function getDoctrineDriver(): PostgresPdoDriver
8080
{
81-
return new PostgresDriver();
81+
return new PostgresPdoDriver();
8282
}
8383
}

0 commit comments

Comments
 (0)