You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doctrine_migrations:
em: default
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
DoctrineMigrations: '%kernel.project_dir%/migrations/gli-agrement'
DoctrineMigrationsBordereau: '%kernel.project_dir%/migrations/bordereau'
Project work perfect, but I have executed query on database without migration bundle. And I would like to reset this important functionality.
First question : how it can detect which migrations directory go with which entityManager ?
It is ok when I execute command bin/console doctrine:m:diff -v --em=bordereau but it put a file in '%kernel.project_dir%/migrations/gli-agrement' while I would like to get it in bordereau directory.
Then when I execute bin/console doctrine:m:m -v --em=bordereau it try to play '%kernel.project_dir%/migrations/gli-agrement' migrations in my bordereau database.
I didn't find the way to associate migrations to an entityManager. The config doc doesn't explain how to configure that. I suppose we should have something like it was specified here : #364 (comment)
doctrine_migrations:
# default_connection: foo #(to specify a connection if there is not a "default" named connection there?)
connections:
default:
migrations_paths:
'DoctrineMigrations\Main': '%kernel.project_dir%/migrations/Main'
geonames:
migrations_paths:
'DoctrineMigrations\Geonames': '%kernel.project_dir%/migrations/Geonames'
# config/packages/doctrine_migrations_bordereau.yaml
doctrine_migrations:
em: bordereau
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
DoctrineMigrations: '%kernel.project_dir%/migrations/bordereau'
But I get this error : Migrations configuration key "doctrine_migrations" does not exist. which is mentioned in this thread #341 and should have been fixed since 2020. So I don't understand
Many thanks in advance for your help.
The text was updated successfully, but these errors were encountered:
I move config/packages/doctrine_migrations_bordereau.yaml to root of my project => /doctrine_migrations_bordereau.yaml then I remove doctrine_migrations: and %kernel.project_dir% that doesn't work so I get this
# /doctrine_migrations_bordereau.yaml -- !!! don't put this file in config/packages
em: bordereau
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
DoctrineMigrations: 'migrations/bordereau'
So I can use : bin/console d:m:m for my default db
and bin/console d:m:m --configuration=doctrine_migrations_bordereau.yaml --dry-run --em=bordereau for my second
But I think it would be usefull to not have a configuration file that is not in package and it would be great to have abilities to configure migrations path for specifics entityManager.
Hello,
I use "doctrine/doctrine-migrations-bundle": "3.2.4" in a Symfony project with two databases.
Here is my configuration:
Project work perfect, but I have executed query on database without migration bundle. And I would like to reset this important functionality.
First question : how it can detect which migrations directory go with which entityManager ?
It is ok when I execute command
bin/console doctrine:m:diff -v --em=bordereau
but it put a file in '%kernel.project_dir%/migrations/gli-agrement' while I would like to get it inbordereau
directory.Then when I execute
bin/console doctrine:m:m -v --em=bordereau
it try to play '%kernel.project_dir%/migrations/gli-agrement' migrations in my bordereau database.I didn't find the way to associate migrations to an entityManager. The config doc doesn't explain how to configure that. I suppose we should have something like it was specified here : #364 (comment)
Something missing here : https://symfony.com/doc/current/doctrine/multiple_entity_managers.html
And here too : https://symfony.com/bundles/DoctrineMigrationsBundle/current/index.html
about multiple connections.
I have tried another way:
with this config :
But I get this error :
Migrations configuration key "doctrine_migrations" does not exist.
which is mentioned in this thread #341 and should have been fixed since 2020. So I don't understandMany thanks in advance for your help.
The text was updated successfully, but these errors were encountered: