On 17 February 2016 at 22:26, 'A K' via doctrine-user <
[email protected]> wrote:

> Hi
>
> Is there a way to change the schema name in the annotation dynamically
> depending on environment?
>

Not at runtime. You'd use a metadata on-load listener (
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#lifecycle-events
), and that can only be done before the ORM is ready for use. Also: you
won't be able to cache metadata.

For example we have standard production env that uses different database
> names than test env, that prefixes all database names with _test. Using
> your proposed annotation would cause all tests to use production database
> names which we do not want to happen.
>

Uhm... Just use a test database connection? :|


Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to