aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2019-08-08 16:40:59 +0200
committerGitHub <noreply@github.com>2019-08-08 16:40:59 +0200
commit5d08dd2799a2c20509c0450181990898c62752fd (patch)
treeb4d89e082942e4711b0e0aa1b02102ae3af21a3b /app/DoctrineMigrations
parent97c678a0b26d748f9829d732910d5c402c609dc2 (diff)
parent1576905e0357ef96cd852ea3c1ff4216af195c34 (diff)
downloadwallabag-5d08dd2799a2c20509c0450181990898c62752fd.tar.gz
wallabag-5d08dd2799a2c20509c0450181990898c62752fd.tar.zst
wallabag-5d08dd2799a2c20509c0450181990898c62752fd.zip
Merge pull request #4084 from wallabag/feature/internal-setting
Rename internal settings table
Diffstat (limited to 'app/DoctrineMigrations')
-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}