aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/5.2.14_add_high_contrast_config_entry.php
blob: d0ffac3cc3b12351d01dc25b7b96a4c98714bc40 (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
32
33
34
35
36
37
38
39
40
41
42
43
<?php


class AddHighContrastConfigEntry extends Migration
{
    public function description()
    {
        return 'Adds configuration field USER_HIGH_CONTRAST';
    }


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

        $db->exec(
            "INSERT IGNORE INTO `config`
            (`field`, `value`, `type`, `range`,
            `section`,
            `mkdate`, `chdate`,
            `description`)
            VALUES
            ('USER_HIGH_CONTRAST', '0', 'boolean', 'user',
            'accessibility', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(),
            'Schaltet ein barrierefreies Stylesheet mit hohem Kontrast ein oder aus.')"
        );
    }


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

        $db->exec(
            "DELETE FROM `config_values`
            WHERE `field` = 'USER_HIGH_CONTRAST'"
        );
        $db->exec(
            "DELETE FROM `config`
            WHERE `field` = 'USER_HIGH_CONTRAST'"
        );
    }
}