Reputation: 11
I'm encountering an issue with Doctrine Migrations in my Symfony application. When I try to run migrations using the command**php bin/console doctrine:migrations:migrate
**, I'm getting the following error:
The schema provider is not available.
I've checked my Symfony configuration and database connection settings, but I'm not sure what could be causing this error. Can anyone provide guidance on how to troubleshoot and resolve this issue?
Additional Information:
Symfony version: 5.8.19
Doctrine version: 2.12.0
Database type: MySQL
Relevant sections of your Symfony configuration files
my Entity class is found on src/Core/Domain/Entity
config/packages/doctrine.yaml
)
doctrine:
dbal:
# configure your database server credentials
driver: 'pdo_mysql'
server_version: '10.4.32'
charset: UTF8
url: '%env(resolve:DATABASE_URL)%'
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/Core/Domain/Entity'
prefix: 'App\Core\Domain\Entity'
alias: App
Any help would be greatly appreciated. Thanks!
php bin/console doctrine:migrations:migrate
Upvotes: 1
Views: 335
Reputation: 2947
Which doctrine-migrations version do you have and how does the configuration look?
According to https://github.com/doctrine/DoctrineMigrationsBundle/issues/418 you have to do following, which worked for me:
doctrine_migrations:
// ..
em: default
I have doctrine/doctrine-migrations-bundle
3.3.1.
Upvotes: 0