diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-08-20 09:34:31 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-08-20 09:34:31 +0200 |
| commit | 325bf7008e4f57e694795a6eab45f374df15c29f (patch) | |
| tree | b3d37014077d981523a37ff6f7e00c8b62a9d66f | |
| parent | ec372269372a8b1d8076a2d263c87368e9aa3dfb (diff) | |
remove table wiki_links via migration, fixes #5833
Closes #5833
Merge request studip/studip!4446
| -rw-r--r-- | db/migrations/5.5.34_remove_table_wiki_links.php | 25 | ||||
| -rw-r--r-- | lib/models/Course.php | 4 |
2 files changed, 25 insertions, 4 deletions
diff --git a/db/migrations/5.5.34_remove_table_wiki_links.php b/db/migrations/5.5.34_remove_table_wiki_links.php new file mode 100644 index 0000000..961a5b4 --- /dev/null +++ b/db/migrations/5.5.34_remove_table_wiki_links.php @@ -0,0 +1,25 @@ +<?php +final class RemoveTableWikiLinks extends Migration +{ + public function description() + { + return 'Removes the table "wiki_links"'; + } + + protected function up() + { + $query = "DROP TABLE `wiki_links`"; + DBManager::get()->exec($query); + } + + protected function down() + { + $query = "CREATE TABLE `wiki_links` ( + `range_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `from_page_id` INT(10) UNSIGNED NOT NULL, + `to_page_id` INT(10) UNSIGNED NOT NULL, + PRIMARY KEY (`range_id`,`to_page_id`,`from_page_id`) + )"; + DBManager::get()->exec($query); + } +} diff --git a/lib/models/Course.php b/lib/models/Course.php index 5d31ffd..6d53399 100644 --- a/lib/models/Course.php +++ b/lib/models/Course.php @@ -391,10 +391,6 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe StudipNews::DeleteNewsRanges($course->id); StudipNews::UnsetRssId($course->id); - //Cleanup remaining wiki table entries: - $query = 'DELETE FROM `wiki_links` WHERE `range_id` = ?'; - DBManager::get()->execute($query, [$course->id]); - //Remove all entries of the course in calendars: $query = 'DELETE FROM `schedule_courses` WHERE `course_id` = ?'; $statement = DBManager::get()->execute($query, [$course->id]); |
