aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/5.5.30_remove_wiki_comments.php
blob: 9329017d246abc9763fd9b0b3b39e634da4c94dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
final class RemoveWikiComments extends Migration
{
    public function description()
    {
        return 'Remove wiki comments configuration setting';
    }

    protected function up()
    {
        $query = "DELETE `config`, `config_values`
                  FROM `config`
                  LEFT JOIN `config_values` USING(`field`)
                  WHERE `field` = 'WIKI_COMMENTS_ENABLE'";
        DBManager::get()->exec($query);
    }

    protected function down()
    {
        $query = "INSERT INTO `config` (`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`)
                  VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)";
        DBManager::get()->execute($query, [
            ':name'        => 'WIKI_COMMENTS_ENABLE',
            ':description' => 'Einstellung für die Anzeige von Kommentaren in Wiki als Icon',
            ':range'       => 'user',
            ':type'        => 'boolean',
            ':value'       => '0'
        ]);
    }
}