aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.94_step237_datafields_mandatory.php
blob: 80c350fdaabb442ff627cf7bc79ba5ba3d01e99c (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
<?php
# refers to https://develop.studip.de/trac/ticket/2568
class Step237DatafieldsMandatory extends Migration
{
    /**
     * short description of this migration
     */
    function description()
    {
        return 'adds  column is_required, description to the table datafields';
    }

    /**
     * perform this migration
     */
    function up()
    {
        DBManager::get()->exec("ALTER TABLE `datafields` ADD `is_required` TINYINT NOT NULL DEFAULT '0', ADD `description` TEXT NOT NULL DEFAULT ''");
    }

    /**
     * revert this migration
     */
    function down()
    {
        DBManager::get()->exec("ALTER TABLE `datafields`   DROP `is_required`,   DROP `description`;");
    }
}