aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-07-02 13:38:32 +0200
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-07-02 13:38:32 +0200
commitef42cb24e702ea11012c2f259fd3f9044dd8dc82 (patch)
tree016641b4d87a4ac9a34b59d51151f75e2b74458a /db
parentab6235391fa68e6dad710449a9b5dfe53cf913d5 (diff)
add migration that removes all orphaned entries from mvv_lvgruppe_seminar, fixes #28
Closes #28 Merge request studip/studip!4312
Diffstat (limited to 'db')
-rw-r--r--db/migrations/5.3.31_cleanup_mvv_lvgruppe_seminar.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrations/5.3.31_cleanup_mvv_lvgruppe_seminar.php b/db/migrations/5.3.31_cleanup_mvv_lvgruppe_seminar.php
new file mode 100644
index 0000000..3b671a4
--- /dev/null
+++ b/db/migrations/5.3.31_cleanup_mvv_lvgruppe_seminar.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * @see https://gitlab.studip.de/studip/studip/-/issues/28
+ */
+final class CleanupMvvLvgruppeSeminar extends Migration
+{
+ public function description()
+ {
+ return 'Removed orphaned course ids from table mvv_lvgruppe_seminar';
+ }
+
+ public function up()
+ {
+ $query = "DELETE FROM `mvv_lvgruppe_seminar`
+ WHERE `seminar_id` NOT IN (
+ SELECT `Seminar_id`
+ FROM `seminare`
+ )";
+ DBManager::get()->exec($query);
+ }
+}