3 namespace Wallabag\CoreBundle\Doctrine
;
5 use Doctrine\DBAL\Migrations\AbstractMigration
;
6 use Doctrine\DBAL\Schema\Schema
;
7 use Symfony\Component\DependencyInjection\ContainerAwareInterface
;
8 use Symfony\Component\DependencyInjection\ContainerInterface
;
10 abstract class WallabagMigration
extends AbstractMigration
implements ContainerAwareInterface
13 * @var ContainerInterface
17 // because there are declared as abstract in `AbstractMigration` we need to delarer here too
18 public function up(Schema
$schema)
22 public function down(Schema
$schema)
26 public function setContainer(ContainerInterface
$container = null)
28 $this->container
= $container;
31 protected function getTable($tableName)
33 $table = $this->container
->getParameter('database_table_prefix') . $tableName;
35 // escape table name is handled using " on postgresql
36 if ('postgresql' === $this->connection
->getDatabasePlatform()->getName()) {
37 return '"' . $table . '"';
40 // return escaped table
41 return '`' . $table . '`';