aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.206_alter_columns_weekoffset_to_int.php
blob: ad4e31298edcfd5c7f6ab464b41080d1b1330172 (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

/**
 * Migration for Ticket #6971 (BIEST)
 *
 * @author  Dominik Feldschnieders <dofeldsc@uos.de>
 * @license GPL2 or any later version
 * Date: 19.10.16
 */
class AlterColumnsWeekoffsetToInt extends Migration
{

    function description()
    {
        return 'Alter the two columns week_offset and end_offset in table seminar_cycle_dates .';
    }

    function up()
    {
        DBManager::get()->exec(
            "ALTER table `seminar_cycle_dates`
             CHANGE column `week_offset` `week_offset` INT NOT NULL DEFAULT '0', CHANGE column `end_offset` `end_offset` INT DEFAULT NULL");
    }

    function down()
    {
        DBManager::get()->exec(
            "ALTER table `seminar_cycle_dates`
             CHANGE column `week_offset` `week_offset` TINYINT NOT NULL DEFAULT '0', CHANGE column `end_offset` `end_offset` TINYINT DEFAULT NULL");
    }

}