We should able to get the table name unescaped

When we want to perform complex queries to retrieve metadata from the database
This commit is contained in:
Jeremy Benoist
2018-06-14 14:15:07 +02:00
parent bfe7a69226
commit 49b4c87598
2 changed files with 11 additions and 5 deletions

View File

@ -9,6 +9,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class WallabagMigration extends AbstractMigration implements ContainerAwareInterface
{
const UN_ESCAPED_TABLE = true;
/**
* @var ContainerInterface
*/
@ -28,10 +30,14 @@ abstract class WallabagMigration extends AbstractMigration implements ContainerA
$this->container = $container;
}
protected function getTable($tableName)
protected function getTable($tableName, $unEscaped = false)
{
$table = $this->container->getParameter('database_table_prefix') . $tableName;
if (self::UN_ESCAPED_TABLE === $unEscaped) {
return $table;
}
// escape table name is handled using " on postgresql
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
return '"' . $table . '"';