diff options
| author | Finn Schneider <schneider@data-quest.de> | 2025-11-27 09:46:32 +0000 |
|---|---|---|
| committer | Murtaza Sultani <sultani@data-quest.de> | 2025-11-27 10:46:32 +0100 |
| commit | 1ad670b6663ff7ada3605fd271ee4f9362ab10b5 (patch) | |
| tree | 84fb595bd48ad9d551121af6055b6f6c409a4521 /db | |
| parent | f5539ca0dace099b495b0b03fb50de16a0a73930 (diff) | |
Resolve "Wiki-Startseite-Umbau"
Closes #5946
Merge request studip/studip!4614
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.5.37_cleanup_wiki_startpage_parent.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/db/migrations/5.5.37_cleanup_wiki_startpage_parent.php b/db/migrations/5.5.37_cleanup_wiki_startpage_parent.php new file mode 100644 index 0000000..74c188a --- /dev/null +++ b/db/migrations/5.5.37_cleanup_wiki_startpage_parent.php @@ -0,0 +1,22 @@ +<?php +/** + * @see https://gitlab.studip.de/studip/studip/-/issues/5946 + */ +class CleanupWikiStartpageParent extends Migration +{ + public function up(): void + { + $query = "SELECT `range_id`, `value` + FROM `config_values` + WHERE `field` = 'WIKI_STARTPAGE_ID'"; + $pages = DBManager::get()->fetchAll($query); + + $query = "UPDATE `wiki_pages` + SET `parent_id` = NULL + WHERE `page_id` = ? AND `range_id` = ?"; + $statement = DBManager::get()->prepare($query); + foreach ($pages as [$range_id, $page_id]) { + $statement->execute([$page_id, $range_id]); + } + } +} |
