diff --git a/db/migrations/6.0.6_adjust_default_cache_name.php b/db/migrations/6.0.6_adjust_default_cache_name.php new file mode 100644 index 0000000000000000000000000000000000000000..ea71f354e2c549633a7ed0169f23bc98fbfc5153 --- /dev/null +++ b/db/migrations/6.0.6_adjust_default_cache_name.php @@ -0,0 +1,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]); + } +};