aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.183_tic6000_datafields_visibility.php
blob: a14f5ff177d929e55fdaaa1b66df21edf8784a62 (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
<?php
/**
 * Adds another visibility setting to datafields
 *
 * @author  Jan-Hendrik Willms <tleilax+studip@gmail.com>
 * @license GPL2 or any later version
 */
class Tic6000DatafieldsVisibility extends Migration
{
    public function description()
    {
        return 'Adds another visibility setting to datafields';
    }

    public function up()
    {
        $query = "ALTER TABLE `datafields`
                    ADD COLUMN `system` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0";
        DBManager::get()->exec($query);
    }

    public function down()
    {
        $query = "ALTER TABLE `datafields` DROP COLUMN `system`";
        DBManager::get()->exec($query);
    }
}