diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-07-02 13:38:32 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-07-02 14:11:01 +0200 |
| commit | f090ba60d3868d22be39a603097637f3913dc475 (patch) | |
| tree | 7fd71e99d052dcee001ec2ffbadf163445e69e56 /db | |
| parent | 22b3a35e6451cf9fcbfd7a5f0a484ec73e823b09 (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.php | 21 |
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); + } +} |
