aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/6.0.18_remove_course_mapping_by_timestamps.php
blob: 015618ca42f99ceb105987aed9aa43af84f02a39 (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
<?php


class RemoveCourseMappingByTimestamps extends Migration
{
    public function description()
    {
        return 'Removes the mapping of courses to semesters by timestamps (by removing seminare.start_time and seminare.duration_time).';
    }

    public function up()
    {
        $db = DBManager::get();
        $db->exec(
            "ALTER TABLE `seminare`
            DROP COLUMN `start_time`,
            DROP COLUMN `duration_time`"
        );
    }

    protected function down()
    {
        $db = DBManager::get();
        $db->exec(
            "ALTER TABLE `seminare`
            ADD COLUMN start_time INT(11) UNSIGNED NULL DEFAULT 0,
            ADD COLUMN duration_time INT(11) NULL DEFAULT NULL"
        );
    }
}