aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.172_tic_5961_add_config_default_sem.php
blob: 9c32999fcd3773322aa27ca1a3ae99aae0170bbe (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
<?php

class Tic5961AddConfigDefaultSem extends Migration
{
    function description()
    {
        return 'adds config option for new my courses';
    }

    function up()
    {
        DBManager::get()->execute("
                INSERT IGNORE INTO `config`
                    (`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`)
                VALUES
                    (MD5(:name), :name, :value, 1, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)
                ", [
            'name'        => 'MY_COURSES_DEFAULT_CYCLE',
            'value'       => 'last',
            'type'        => 'string',
            'range'       => 'global',
            'section'     => 'MeineVeranstaltungen',
            'description' => 'Standardeinstellung für den Semester-Filter, falls noch keine Auswahl getätigt wurde. (all, future, current, last)',
            ]
        );
    }

    function down()
    {
        DBManager::get()->exec("DELETE FROM config WHERE `field` = 'MY_COURSES_DEFAULT_CYCLE'");
    }
}