aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.76_termin_related_persons.php
blob: 8b113dedf5d6b84f4b0dd0dd40ca528552a24d4f (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
<?php

class TerminRelatedPersons extends Migration
{
    /**
     * short description of this migration
     */
    function description()
    {
        return 'adds the table termin_related_persons to DB';
    }

    /**
     * perform this migration
     */
    function up()
    {
        $db = DBManager::get();
        $db->exec(
            "CREATE TABLE IF NOT EXISTS `termin_related_persons` ( " .
                "`range_id` varchar(32) NOT NULL, " .
                "`user_id` varchar(32) NOT NULL, " .
                "PRIMARY KEY (`range_id`,`user_id`) " .
            ") ENGINE=MyISAM"
        );
    }

    /**
     * revert this migration
     */
    function down()
    {
        $db = DBManager::get();
        $db->exec("DROP TABLE `termin_related_persons` ");
    }
}