aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2026-02-10 17:21:42 +0100
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2026-02-10 17:21:42 +0100
commit7dc2d3e1266810b98758faeaf3bd4dcab04330ce (patch)
tree78326b91a20d6ab67168157218b47e00a3255062 /db
parent6aa14641c923d96fecbf7394c7ddf15d06bb9cd3 (diff)
allow forum in institutes as well, fixes #6189
Closes #6189 Merge request studip/studip!4687
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.1.18_fix_forum_configurations.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/db/migrations/6.1.18_fix_forum_configurations.php b/db/migrations/6.1.18_fix_forum_configurations.php
new file mode 100644
index 0000000..aa921fa
--- /dev/null
+++ b/db/migrations/6.1.18_fix_forum_configurations.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @see https://gitlab.studip.de/studip/studip/-/issues/6189
+ */
+final class FixForumConfigurations extends Migration
+{
+ public function description()
+ {
+ return 'Fixes new forum configurations to be applied to ranges and not only to courses';
+ }
+
+ protected function up()
+ {
+ $query = "UPDATE `config`
+ SET `range` = 'range'
+ WHERE `field` IN (
+ 'FORUM_MODERATION_PERMISSION',
+ 'FORUM_HIDE_CATEGORIES_NAVIGATION'
+ )";
+ DBManager::get()->exec($query);
+ }
+
+ protected function down()
+ {
+ $query = "UPDATE `config`
+ SET `range` = 'course'
+ WHERE `field` IN (
+ 'FORUM_MODERATION_PERMISSION',
+ 'FORUM_HIDE_CATEGORIES_NAVIGATION'
+ )";
+ DBManager::get()->exec($query);
+ }
+}