aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/6.0.6_adjust_default_cache_name.php
blob: ea71f354e2c549633a7ed0169f23bc98fbfc5153 (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
<?php
/**
 * @see https://gitlab.studip.de/studip/studip/-/issues/4196
 */
return new class extends Migration
{
    public function description()
    {
        return 'Adjust the default cache in table "config" as well"';
    }

    protected function up()
    {
        $query = "UPDATE `config`
                  SET `value` = JSON_REPLACE(`value`, '$.type', ?)
                  WHERE `field` = 'SYSTEMCACHE'";
        DBManager::get()->execute($query, [Studip\Cache\DbCache::class]);
    }

    protected function down()
    {
        $query = "UPDATE `config`
                  SET `value` = JSON_REPLACE(`value`, '$.type', ?)
                  WHERE `field` = 'SYSTEMCACHE'";
        DBManager::get()->execute($query, [StudipDbCache::class]);
    }
};