diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-06-18 12:54:33 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-06-18 12:54:33 +0200 |
| commit | 16aa107cd9ae7c8a2152ecde5db039fab6c78fde (patch) | |
| tree | 677494cff8693c1050d4296945728affe93c2526 /db/migrations | |
| parent | f4bbd3e5c9d283a6a00cc36c3ade95585bbfde1c (diff) | |
add migration that removes configuration WIKI_COURSE_EDIT_RESTRICTED, fixes #5342
Closes #5342
Merge request studip/studip!4010
Diffstat (limited to 'db/migrations')
| -rw-r--r-- | db/migrations/5.5.31_remove_wiki_course_edit_restriction_configuration.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/db/migrations/5.5.31_remove_wiki_course_edit_restriction_configuration.php b/db/migrations/5.5.31_remove_wiki_course_edit_restriction_configuration.php new file mode 100644 index 0000000..59d12bd --- /dev/null +++ b/db/migrations/5.5.31_remove_wiki_course_edit_restriction_configuration.php @@ -0,0 +1,30 @@ +<?php +final class RemoveWikiCourseEditRestrictionConfiguration extends Migration +{ + public function description() + { + return 'Removes configuration "WIKI_COURSE_EDIT_RESTRICTED"'; + } + + public function up() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'WIKI_COURSE_EDIT_RESTRICTED'"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "INSERT INTO `config` (`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; + DBManager::get()->execute($query, [ + 'name' => 'WIKI_COURSE_EDIT_RESTRICTED', + 'description' => 'Legt fest, dass nur Teilnehmende ab Rechtestufe "tutor" das Wiki bearbeiten dürfen.', + 'range' => 'course', + 'type' => 'boolean', + 'value' => '0' + ]); + } +} |
