Closed terabytesoftw closed 4 years ago
Is Connection.php the one in this repository? The line number seems weird: https://github.com/yiisoft/db/blob/master/src/Connection.php#L823
Can you run composer update
to make sure you're on the latests versions?
Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
Thanks!
This is an automated comment, triggered by adding the label status:need more info
.
Of course, you can try it without having any migration give the error.
composer show
yiisoft/active-record dev-master 0fdc73d Yii ActiveRecord Library
yiisoft/cache dev-master f9aa30c Yii Caching Library
yiisoft/db dev-master e93aa75 Yii DataBase Library
yiisoft/db-mysql dev-master 4a71bdf Yii DataBase MySQL Extension
yiisoft/di dev-master ea2196e Yii DI container
yiisoft/log dev-master 30d24a5 Yii Logging Library
yiisoft/rbac dev-master f248a22 Yii Role-Based Access Control Library
yiisoft/view dev-master 58a2fa1 Yii View Rendering Library
yiisoft/yii-bootstrap4 dev-master 6067cd7 Yii Framework Twitter Bootstrap 4 Extension
yiisoft/yii-captcha dev-master 0adcf8e Yii Framework CAPTCHA Extension
yiisoft/yii-console dev-master 93170cb Yii Framework Console Extension
yiisoft/yii-core dev-master ad5a548 Yii Framework Core
yiisoft/yii-dataview dev-master cb6dca6 Yii Framework Data Displaying Extension
yiisoft/yii-debug dev-master f270096 Yii Framework Debug Panel Extension
yiisoft/yii-jquery dev-master 94fcabb Yii Framework jQuery Extension
yiisoft/yii-swiftmailer dev-master 539fe59 Yii Framework Swift Mailer Extension
yiisoft/yii-web dev-master 7001826 Yii Framework Web Extension
$ vendor/bin/yii migrate
Yii Migration Tool (based on Yii v3.0.0-dev)
Error: Class 'yii\db\pgsql\Schema' not found
--
The problem lies in the config/common.php, of db, if I configure it directly without parameters it works perfect.
'db' => [
'__class' => \yii\db\Connection::class,
'dsn' => 'pgsql:dbname=' . $params['db.name']
. (!empty($params['db.host']) ? (';host=' . $params['db.host']) : '')
. (!empty($params['db.port']) ? (';port=' . $params['db.port']) : ''),
'username' => $params['db.user'],
'password' => $params['db.password'],
],
cc @hiqsol any reasons why this was decided as default configuration?
I think we should either ship no configuration beside __class
, or have another param like db.type
(or db.dsn
with the whole connection string)
What steps will reproduce the problem?
vendor/bin/yii migrate
What is the expected result?
Migration tables
Additional info
A few days ago it worked perfect, I only use mysql, I do not understand why it asks for the pgsql driver.