aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.123_tic_3993_remove_dont_delete.php
blob: 3d7da57dce087c908589d20d27f2459223e8d06a (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
<?php
# refers to https://develop.studip.de/trac/ticket/3993
class Tic3993RemoveDontDelete extends Migration
{
    /**
     * short description of this migration
     */
    function description()
    {
        return 'remove unused feature to protect messages from deletion';
    }

    /**
     * perform this migration
     */
    function up()
    {
        $db = DBManager::get();

        try {
            $db->exec("ALTER TABLE `message` DROP COLUMN `dont_delete`");
        } catch (Exception $e) { }
    }


    /**
     * revert this migration
     */
    function down()
    {
        DBManager::get()->exec('ALTER TABLE `message` ADD `dont_delete` tinyint(1) NOT NULL DEFAULT \'0\' AFTER `snd_rec`');
    }
}