php - Doctrine Migrations Namespace Error -
i trying setup doctrine migrations on top of silex framework. installed through composer.
"doctrine/dbal": "2.3.*", "doctrine/migrations": "dev-master", my console file:
... $app['composer_loader']->add('doctrine\dbal\migrations', __dir__.'/../vendor/doctrine/migrations/lib/'); $helperset = new \symfony\component\console\helper\helperset(array( "db" => new \doctrine\dbal\tools\console\helper\connectionhelper($app['db']), "dialog" => new \symfony\component\console\helper\dialoghelper(), )); $console->sethelperset($helperset); $console->addcommands(array( // migrations commands new \doctrine\dbal\migrations\tools\console\command\diffcommand(), new \doctrine\dbal\migrations\tools\console\command\executecommand(), new \doctrine\dbal\migrations\tools\console\command\generatecommand(), new \doctrine\dbal\migrations\tools\console\command\migratecommand(), new \doctrine\dbal\migrations\tools\console\command\statuscommand(), new \doctrine\dbal\migrations\tools\console\command\versioncommand() )); $console->run(); however when run migrations:status outputs:
c:\htdocs\bitvenda\app>php console.php migrations:status [doctrine\dbal\migrations\migrationexception] migrations namespace must configured in order use doctrine migrations . what doing wrong?
as @medina commented. missed configuration file. created yml config file below:
name: doctrine migrations migrations_namespace: doctrinemigrations table_name: doctrine_migration_versions migrations_directory: /data/doctrinemigrations and passed configuration file path argument working.
php console.php migrations:status --configuration=config/migrations.yml to avoid passing time, changed working script dir same dir configuration file doctrine migrations loads automatically
chdir(__dir__.'/config');
Comments
Post a Comment