You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would a PR for a feature to provide a db table name prefix be accepted?
A use case is that a user would like to prefix his tables with a certain prefix. Therefor we could add the @ORM\Table annotation if a prefix is defined. Together with the prefix we could generate the db name based on the namingstrategy setup in the doctrine config.
Some pseudo code for a method in the doctrine helper:
public function getTableName($className)
{
$em = $this->getRegistry()->getManagerForClass($className);
if (null === $em) {
$em = $this->getRegistry()->getManager();
}
$tableName = $em->getConfiguration()->getNamingStrategy()->classToTableName($className);
return $tableName;
}
That way we can reliable determin the table name and add the given prefix. If no prefix is defined I would suggest to not add the @Table annotation
The text was updated successfully, but these errors were encountered:
Would a PR for a feature to provide a db table name prefix be accepted?
A use case is that a user would like to prefix his tables with a certain prefix. Therefor we could add the
@ORM\Table
annotation if a prefix is defined. Together with the prefix we could generate the db name based on the namingstrategy setup in the doctrine config.Some pseudo code for a method in the doctrine helper:
That way we can reliable determin the table name and add the given prefix. If no prefix is defined I would suggest to not add the
@Table
annotationThe text was updated successfully, but these errors were encountered: