Configurate doctrine_migration_versions table in custom schema instead of public

Viewed 283

Is there a way for the automatic doctrine_migration_versionsto be stored in a schema other than public?

Right now I have a schema called inschrijving and all the entities properties are stored as tables and columns within that schema, but not the doctrine migration versions table.

Here's how my entities are stored: enter image description here

And the doctrine_migration_versions is stored in the public schema: enter image description here

I cannot find anywhere how to configure doctrine in order for the doctrine_migration_versions to be stored within the inschrijving schema instead of the public schema

1 Answers

Found it myself by asking in another forum, but if anyone is interested:

doctrine_migrations:
    storage:
        # Default (SQL table) metadata storage configuration
        table_storage:
            table_name: 'inschrijving.doctrine_migration_versions'

You will need to create the schema manually in the db before applying migrations, though.

CREATE SCHEMA inschrijving;

And then

php bin/console doctrine:migrations:migrate

And it should look like this: enter image description here

Related