aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.200_step_00299_statusgroups.php
blob: 7544ef9d6ba13d4331ce131907235df98c082398 (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
33
34
35
36
37
38
39
40
41
<?php
/**
 * Migration for StEP00299
 *
 * @author  Thomas Hackl <thomas.hackl@uni-passau.de>
 * @license GPL2 or any later version
 * @since   Stud.IP 3.5
 *
 * @see https://develop.studip.de/trac/ticket/6590
 */
class StEP00299Statusgroups extends Migration
{

    /**
     * Describe what the migration does.
     * @return string
     */
    public function description()
    {
        return 'Adds columns for selfassign start and end time to table statusgruppen';
    }

    /**
     * Add a new database column to table statusgruppen: optional start time for self assignment.
     */
    public function up()
    {
        DBManager::get()->execute("ALTER TABLE `statusgruppen`
            ADD `selfassign_start` INT NOT NULL DEFAULT 0 AFTER `selfassign`,
            ADD `selfassign_end` INT NOT NULL DEFAULT 0 AFTER `selfassign_start`");
    }

    /**
     * Drops database column for start time of self assignment.
     */
    public function down()
    {
        DBManager::get()->execute("ALTER TABLE `statusgruppen` DROP `selfassign_start`");
    }

}