diff --git a/db/migrations/5.1.40_drop_table_blubber_follower.php b/db/migrations/5.1.40_drop_table_blubber_follower.php new file mode 100644 index 0000000000000000000000000000000000000000..fe32e6e1b473946326e808d1df629e98e1528a8b --- /dev/null +++ b/db/migrations/5.1.40_drop_table_blubber_follower.php @@ -0,0 +1,30 @@ +<?php + +/** + * @see https://gitlab.studip.de/studip/studip/-/issues/2082 + */ +final class DropTableBlubberFollower extends Migration +{ + public function description() + { + return 'Removes unused table "blubber_follower"'; + } + + protected function up() + { + $query = "DROP TABLE IF EXISTS `blubber_follower`"; + DBManager::get()->exec($query); + } + + protected function down() + { + $query = "CREATE TABLE IF NOT EXISTS `blubber_follower` ( + `studip_user_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `external_contact_id` CHAR(32) COLLATE latin1_bin NOT NULL, + `left_follows_right` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + KEY `studip_user_id` (`studip_user_id`), + KEY `external_contact_id` (`external_contact_id`) + )"; + DBManager::get()->exec($query); + } +} diff --git a/lib/models/User.class.php b/lib/models/User.class.php index 5cf1e18a421c1733b0df107cfef726e2f96e0ecd..9c6430f7c7b02282db5f457b2ca22e1ed16a8706 100644 --- a/lib/models/User.class.php +++ b/lib/models/User.class.php @@ -1258,9 +1258,6 @@ class User extends AuthUserMd5 implements Range, PrivacyObject $query = "UPDATE IGNORE blubber_comments SET user_id = ? WHERE user_id = ?"; $statement = DBManager::get()->prepare($query); $statement->execute([$new_id, $old_id]); - $query = "UPDATE IGNORE blubber_follower SET studip_user_id = ? WHERE studip_user_id = ?"; - $statement = DBManager::get()->prepare($query); - $statement->execute([$new_id, $old_id]); $query = "UPDATE IGNORE blubber_mentions SET user_id = ? WHERE user_id = ?"; $statement = DBManager::get()->prepare($query); $statement->execute([$new_id, $old_id]);