aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.71_step_00192_page_layout.php
blob: 6f105e26b6d2e1035591bcf5e398bf77cbda93a4 (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
<?php

class Step00192PageLayout extends Migration
{
    /**
     * short description of this migration
     */
    function description()
    {
        return 'remove obsolete HTML_HEAD_TITLE config setting';
    }

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

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

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

        $stmt->execute([
            'name' => 'HTML_HEAD_TITLE',
            'description' => 'Angezeigter Titel in der Kopfzeile des Browsers',
            'section' => 'global',
            'type' => 'string',
            'value' => 'Stud.IP'
        ]);
    }
}