我有两个Symfony应用程序映射到同一个PgSQL数据库。这两个应用程序都使用FOSUserBundle,因此我正在尝试在不同的模式下处理用户。通过阅读和进行一些谷歌研究,我按照以下方式构建了我的实体:
/**
* @ORM\Entity
* @ORM\Table(name="internal_users", schema="internal")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
*/
class InternalUser extends BaseUser
{
...
}
接下来我尝试在Symfony2的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 >
但是表格生成在public
模式下,而不是我想要的internal
模式下,我做错了什么?有没有办法在不同的模式下创建表格?
@ORM\Table(name="internal.internal_users")
。 - Salem