Doctrine Conversion and PostgreSQL Schemas

I have two Symfony applications mapped to the same PgSQL database. Both applications use FOSUserBundle, so I am trying to handle users in different schemes. Reading and doing some research on Google, I build my entities as follows:

/**
 * @ORM\Entity
 * @ORM\Table(name="internal_users", schema="internal")
 * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
 */
class InternalUser extends BaseUser
{
    ...
}

Then I tried the following from the Symofny2 shell:

Symfony > doctrine:schema:validate
[Mapping]  OK - The mapping files are correct.
[Database] FAIL - The database schema is not in sync with the current mapping file.
The command terminated with an error status (2)
Symfony > doctrine:schema:update --force
Updating database schema...
Database schema updated successfully! "14" queries were executed
Symfony >

But the tables were generated in the schema public, and not in the schema internal, how do I want what I did wrong? Any way to create tables in different schemas?

+4
source share
2 answers

SCHEMA.TABLE :

@ORM\Table(name="internal.internal_users")
+4

Doctrine ORM 2.5 schema:

@ORM\Table(schema="internal")

Reference

0

All Articles