aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.162_step_00283_calendar_user.php
blob: 4ec8e6c1fd1f1c9353d13268a2e59832fb5adc87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
class Step00283CalendarUser extends Migration {

    function description() {
        return 'New table to manage access to user calendars. It replaces the former access management in contacts and contact groups.';
    }

    function up() {
        DBManager::get()->execute("CREATE TABLE IF NOT EXISTS `calendar_user` (
            `owner_id` varchar(32) NOT NULL,
            `user_id` varchar(32) NOT NULL,
            `permission` int(2) NOT NULL,
            `mkdate` int(11) NOT NULL,
            `chdate` int(11) NOT NULL,
            PRIMARY KEY (`owner_id`,`user_id`)
        ) ENGINE=MyISAM");
    }

    function down() {
        DBManager::get()->execute('DROP TABLE IF EXISTS calendar_user');
    }

}