aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations/Version20190808124957.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/DoctrineMigrations/Version20190808124957.php')
-rw-r--r--app/DoctrineMigrations/Version20190808124957.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/app/DoctrineMigrations/Version20190808124957.php b/app/DoctrineMigrations/Version20190808124957.php
new file mode 100644
index 00000000..4e12e995
--- /dev/null
+++ b/app/DoctrineMigrations/Version20190808124957.php
@@ -0,0 +1,42 @@
1<?php
2
3namespace Application\Migrations;
4
5use Doctrine\DBAL\Schema\Schema;
6use Wallabag\CoreBundle\Doctrine\WallabagMigration;
7
8/**
9 * Change the internal setting table name.
10 */
11final class Version20190808124957 extends WallabagMigration
12{
13 public function up(Schema $schema): void
14 {
15 switch ($this->connection->getDatabasePlatform()->getName()) {
16 case 'sqlite':
17 $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
18 break;
19 case 'mysql':
20 $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
21 break;
22 case 'postgresql':
23 $this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
24 break;
25 }
26 }
27
28 public function down(Schema $schema): void
29 {
30 switch ($this->connection->getDatabasePlatform()->getName()) {
31 case 'sqlite':
32 $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
33 break;
34 case 'mysql':
35 $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
36 break;
37 case 'postgresql':
38 $this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
39 break;
40 }
41 }
42}