aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
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);
+ }
+}