aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.301_tiled_courses_3.php
blob: 79b6f7e9bd61f96a20a51bd0cbc1beaa0abf4f90 (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
<?php
class TiledCourses3 extends Migration
{
    public function description()
    {
        return 'Splits config setting for tiles/tables view into responsive/non responsive mode';
    }

    public function up()
    {
        $query = "INSERT IGNORE INTO `config` (
                    `field`, `value`, `type`, `range`,
                    `section`, `description`,
                    `mkdate`, `chdate`
                  ) VALUES (
                    'MY_COURSES_TILED_DISPLAY_RESPONSIVE', '1', 'boolean', 'user',
                    'MeineVeranstaltungen', 'Hat die Kachelansicht unter \"Meine Veranstaltungen\" aktiviert (responsiv)',
                    UNIX_TIMESTAMP(), UNIX_TIMESTAMP()
                  )";
        DBManager::get()->exec($query);
    }

    public function down()
    {
        $query = "DELETE `config`, `config_values`
                  FROM `config`
                  LEFT JOIN `config_values` USING (`field`)
                  WHERE `field` = 'MY_COURSES_TILED_DISPLAY_RESPONSIVE'";
        DBManager::get()->exec($query);
    }
}