Roman Andreev
Roman Andreev

Reputation: 454

How can I specify to what schema I need to apply my migration using Symfony doctrine?

When I use ./bin/console doctrine:migrations:migrate command my migrations apply to public schema. But in my Entities I set another schema :

/**
 * @ORM\Entity(repositoryClass="App\Repository\MyEntityRepository")
 * @ORM\Table(schema="schemaname", name="entity")
 */
class MyEntity

How can I specify to what schema I need to apply my migration using Symfony doctrine?

Upvotes: 1

Views: 1358

Answers (1)

SilvioQ
SilvioQ

Reputation: 2072

Use this configuration in your doctrine bundle configuration

doctrine_migrations:
    ...
    table_name: myschema.migration_version
    ...

Oficial documentation in https://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html#configuration

Upvotes: 1

Related Questions