Я пытаюсь запустить Doctrine-миграции в проекте Symfony3.4, но я застрял на пару дней.
Кто-нибудь сталкивался с такой же проблемой? Как заставить это работать?
Заранее спасибо!
php bin/console doctrine:migrations:migrate Version20180909015642
19:03:19 ERROR [console] Error thrown while running command
"doctrine:migrations:migrate". Message: "An exception occured in
driver: SQLSTATE[HY000] [2002] No such file or directory" ["exception"
=> Doctrine\DBAL\Exception\ConnectionException { …},"command" =>
"doctrine:migrations:migrate","message" => "An exception occured in
driver: SQLSTATE[HY000] [2002] No such file or directory"] []
In AbstractMySQLDriver.php line 103:
An exception occured in driver: SQLSTATE[HY000] [2002] No such file
or directory
In PDOConnection.php line 47:
SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 43:
SQLSTATE[HY000] [2002] No such file or directory
Пакет зарегистрирован в AppKernel.php
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
В config.yml
doctrine_migrations:
dir_name: "%kernel.root_dir%/DoctrineMigrations"
namespace: Application\Migrations
table_name: doctrine_migration_versions
name: Application_Migrations_Default
Приложение / DoctrineMigrations / Version20180909015642.php
<?php
declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180909015642 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
//...
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
//...
}
}