diff --git a/db/migrations/5.5.14_cleanup_cw_tasks.php b/db/migrations/5.1.53_cleanup_cw_tasks.php similarity index 92% rename from db/migrations/5.5.14_cleanup_cw_tasks.php rename to db/migrations/5.1.53_cleanup_cw_tasks.php index 94ab0198946bc8c876b42431377e9fefef07e4a0..8df653d5b538733907637b9d5ca9cee7c2db7cc6 100644 --- a/db/migrations/5.5.14_cleanup_cw_tasks.php +++ b/db/migrations/5.1.53_cleanup_cw_tasks.php @@ -11,7 +11,7 @@ final class CleanupCwTasks extends Migration { DBManager::get()->exec(' DELETE FROM `cw_tasks` - WHERE `solver_type` = "user" + WHERE `solver_type` = "autor" AND `solver_id` NOT IN (SELECT `user_id` FROM `auth_user_md5`)' ); DBManager::get()->exec(' diff --git a/db/migrations/5.5.14_cleanup_cw_tasks_placeholder.php b/db/migrations/5.5.14_cleanup_cw_tasks_placeholder.php new file mode 100644 index 0000000000000000000000000000000000000000..cba0d26ebc48123316ae7924f7cf01559c0adfd0 --- /dev/null +++ b/db/migrations/5.5.14_cleanup_cw_tasks_placeholder.php @@ -0,0 +1,17 @@ +<?php +/** + * This migration only exists as a placeholder for the original + * migration 5.5.14 which has been renumbered to 5.1.53 as it was + * downported. + * As everything has already been done in 5.1.53, nothing happens here. + * + * @see https://gitlab.studip.de/studip/studip/-/issues/3669 + */ + +final class CleanupCwTasksPlaceholder extends Migration +{ + public function description() + { + return 'empty placeholder for former migration with wrong number -> see 5.1.53'; + } +} diff --git a/lib/classes/UserManagement.class.php b/lib/classes/UserManagement.class.php index 620672c641f485ae71efbaab69ae1c85907647ea..1a49aed31240f6310df5b683fe8546dde6c91e12 100644 --- a/lib/classes/UserManagement.class.php +++ b/lib/classes/UserManagement.class.php @@ -990,7 +990,7 @@ class UserManagement \Courseware\UserProgress::deleteBySQL('user_id = ?', [$this->user_data['auth_user_md5.user_id']]); \Courseware\Bookmark::deleteBySQL('user_id = ?', [$this->user_data['auth_user_md5.user_id']]); \Courseware\Task::deleteBySQL( - '`solver_id` = ? AND `solver_type`= "user"', + '`solver_id` = ? AND `solver_type`= "autor"', [$this->user_data['auth_user_md5.user_id']] ); // delete courseware elements in courses of this user