aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.34_add_allow_selfassign_institute.php
blob: d5a5b6092397d5eb27aea53c3b2992845133da1d (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
<?
class AddAllowSelfassignInstitute extends Migration
{
    function description ()
    {
        return 'add config option for separated en-/disabling studycourse and institute self-assignment';
    }

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

        $name = 'ALLOW_SELFASSIGN_INSTITUTE';
        $description = 'Wenn eingeschaltet, dürfen Studenten sich selbst Einrichtungen an denen sie studieren zuordnen.';
        $time = time();

        $db->exec("
            INSERT INTO config
                (config_id, field, value, is_default, type, mkdate, chdate, description)
            VALUES
                (MD5('$name'), '$name', '1', 1, 'boolean', $time, $time, '$description')
        ");
    }

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

        $db->exec("DELETE FROM config WHERE field = 'ALLOW_SELFASSIGN_INSTITUTE'");
    }
}
?>