aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.166_add_cache_operations_table.php
blob: 671152f15c707760f4e059068958471f79c4f113 (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
<?php
/**
 * Migration for proxied cache operations.
 *
 * @author  Jan-Hendrik Willms <tleilax+studip@gmail.com>
 * @license GPL2 or any later version
 * @since   Stud.IP 3.3
 */
class AddCacheOperationsTable extends Migration
{
    public function description()
    {
        return 'Creates the database table for proxied cache operations';
    }

    public function up()
    {
        $query = "CREATE TABLE IF NOT EXISTS `cache_operations` (
                      `cache_key` VARCHAR(256) NOT NULL DEFAULT '',
                      `operation` CHAR(6) NOT NULL DEFAULT '',
                      `parameters` TEXT NOT NULL,
                      `mkdate` INT(11) UNSIGNED NOT NULL,
                      `chdate` INT(11) UNSIGNED NOT NULL,
                      PRIMARY KEY (`cache_key`(200), `operation`)
                  )";
        DBManager::get()->exec($query);
    }

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