I have a problem with doctrine-module console using zend framework 2 and postgresql
ricardo@notebook:/var/www/zendskeleton$ bin/doctrine-module orm:schema-tool:create
PHP Warning: array_map(): An error occurred while invoking the map callback in /var/www/zendskeleton/vendor/doctrine/doctrine-orm-module/src/DoctrineORMModule/Module.php on line 138
Warning: array_map(): An error occurred while invoking the map callback in /var/www/zendskeleton/vendor/doctrine/doctrine-orm-module/src/DoctrineORMModule/Module.php on line 138
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] FATAL: database "zend" does not exist' in /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('pgsql:host=loca...', 'postgres', 'morphy09', Array)
#1 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php(46): Doctrine\DBAL\Driver\PDOConnection->__construct('pgsql:host=loca...', 'postgres', 'postgres', Array)
#2 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOPgSql\Driver->connect(Array, 'postgres', 'postgres', Array)
#3 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): Doctrine\DBAL\Connection->connect()
#4 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#5 /var/www/zendskeleton/vendor/doctrine/dbal/li in /var/www/zendskeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 930
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] FATAL: database "zend" does not exist' in /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('pgsql:host=loca...', 'postgres', 'postgres', Array)
#1 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php(46): Doctrine\DBAL\Driver\PDOConnection->__construct('pgsql:host=loca...', 'postgres', 'postgres', Array)
#2 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOPgSql\Driver->connect(Array, 'postgres', 'postgres', Array)
#3 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): Doctrine\DBAL\Connection->connect()
#4 /var/www/zendskeleton/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#5 /var/www/utilcore/vendor/doctrine/dbal/li in /var/www/zendskeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 930
I have a doctrine.local.php config file:
<?php
return [
'doctrine' => [
'connection' => [
'orm_default' => [
'driverClass' =>'Doctrine\DBAL\Driver\PDOPgSql\Driver',
'params' => [
'host' => 'localhost',
'port' => '5432',
'user' => 'postgres',
'password' => 'postgres',
'dbname' => 'zend',
]
]
]
]
];
Basically, I cant create my database using doctrine-module cli command.
Why i'm getting this error?
If I create the database using psql all the doctrine-module commands works very well, but the doctrine-module orm:schema-tool:create is there for this?