Вот как может выглядеть стандартный doctrine .yaml (SF5.0 !, Doctrine2.0)
// YOUR_NAMESPACE \ config \ packages \ doctrine .yaml
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
server_version: '10.4'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'YOUR_NAMESPACE\Entity'
alias: YOUR_NAMESPACE
и .env.local
DATABASE_URL=mysql://root:123@127.0.0.1:3306/myproject2
ваш composer. json должен содержать в требуемом сегменте
"doctrine/doctrine-bundle": "^2.0",
"doctrine/doctrine-migrations-bundle": "2.1.*",
"doctrine/orm": "2.7.*",
и в вашем doctrine_migrations.yaml
// YOUR_NAMESPACE \ config \ packages \ doctrine_migrations.yaml
doctrine_migrations:
dir_name: '%kernel.project_dir%/src/Migrations'
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
namespace: DoctrineMigrations