aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.73_step_00193_html_email.php
blob: 77578ac5f2e7feb1ae50edc351a9b3e2efd3616c (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
44
45
46
<?php

class Step00193HtmlEmail extends Migration
{
    /**
     * short description of this migration
     */
    function description()
    {
        return 'add MAIL_AS_HTML config setting';
    }

    /**
     * perform this migration
     */
    function up()
    {
        $db = DBManager::get();
        $time = time();

        $stmt = $db->prepare("
                INSERT INTO config
                    (config_id, field, value, is_default, type, `range`, section, mkdate, chdate, description)
                VALUES
                    (MD5(:name), :name, :value, 1, :type, :range, :section, $time, $time, :description)
                ");

        $stmt->execute([
            'name' => 'MAIL_AS_HTML',
            'description' => 'Benachrichtigungen werden im HTML-Format versandt',
            'section' => '',
            'range' => 'user',
            'type' => 'boolean',
            'value' => 0
        ]);
    }

    /**
     * revert this migration
     */
    function down()
    {
        $db = DBManager::get();
        $db->exec("DELETE FROM config WHERE field = 'MAIL_AS_HTML'");
    }
}