aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.279_config_wiki_comments_enable.php
blob: ce52b35ef843e1bbf0861efe7d98859c752385ab (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
31
<?php
class ConfigWikiCommentsEnable extends Migration
{
    public function description()
    {
        return 'add config option for WIKI_COMMENTS_ENABLE';
    }

    public function up()
    {
        $db = DBManager::get();

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

    public function down()
    {
        $db = DBManager::get();

        $stmt = $db->prepare('DELETE config, config_values FROM config LEFT JOIN config_values USING(field) WHERE field = ?');
        $stmt->execute(['WIKI_COMMENTS_ENABLE']);
    }
}