From b8fa1b13a65f448ce6a8ac0745acc123f4af627e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 1 Jul 2019 13:38:53 +0200 Subject: Fix hardcoded `wallabag_` prefix in migration Again. Looks like there are still some which were missing to be replaced. --- app/DoctrineMigrations/Version20170511211659.php | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'app/DoctrineMigrations/Version20170511211659.php') diff --git a/app/DoctrineMigrations/Version20170511211659.php b/app/DoctrineMigrations/Version20170511211659.php index 00ce7b1f..d0752baf 100644 --- a/app/DoctrineMigrations/Version20170511211659.php +++ b/app/DoctrineMigrations/Version20170511211659.php @@ -13,19 +13,21 @@ class Version20170511211659 extends WallabagMigration { public function up(Schema $schema) { - $tableName = $this->getTable('annotation'); - switch ($this->connection->getDatabasePlatform()->getName()) { case 'sqlite': + $annotationTableName = $this->getTable('annotation', true); + $userTableName = $this->getTable('user', true); + $entryTableName = $this->getTable('entry', true); + $this->addSql(<<addSql('DROP TABLE ' . $tableName); + $this->addSql('DROP TABLE ' . $annotationTableName); $this->addSql(<<addSql(<<addSql('DROP TABLE __temp__wallabag_annotation'); break; case 'mysql': - $this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote TEXT NOT NULL'); + $this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL'); break; case 'postgresql': - $this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE TEXT'); + $this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT'); break; } } -- cgit v1.2.3