From 084437e5df141bdf07678a43b102025d034f464f Mon Sep 17 00:00:00 2001 From: Manuel Schwarz <manschwa@uos.de> Date: Tue, 20 Jul 2021 12:41:45 +0200 Subject: [PATCH] Fix collation for OSKA DB tables (was very slow in production). --- migrations/003_fix_collation.php | 32 ++++++++++++++++++++++++++++++++ plugin.manifest | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 migrations/003_fix_collation.php diff --git a/migrations/003_fix_collation.php b/migrations/003_fix_collation.php new file mode 100644 index 0000000..ca71e00 --- /dev/null +++ b/migrations/003_fix_collation.php @@ -0,0 +1,32 @@ +<?php + +class FixCollation extends Migration +{ + public function description() + { + return 'fix collation for OSKA tables'; + } + + public function up() + { + $db = DBManager::get(); + + $sql = 'ALTER TABLE oska_mentors + CHANGE user_id user_id VARCHAR(32) COLLATE latin1_bin NOT NULL, + CHANGE teacher teacher TINYINT(1) NOT NULL DEFAULT 0'; + $db->exec($sql); + + $sql = 'ALTER TABLE oska_mentees + CHANGE user_id user_id VARCHAR(32) COLLATE latin1_bin NOT NULL'; + $db->exec($sql); + + $sql = 'ALTER TABLE oska_matches + CHANGE mentor_id mentor_id VARCHAR(32) COLLATE latin1_bin NOT NULL, + CHANGE mentee_id mentee_id VARCHAR(32) COLLATE latin1_bin NOT NULL'; + $db->exec($sql); + } + + public function down() + { + } +} diff --git a/plugin.manifest b/plugin.manifest index 2dddc14..f2bba71 100644 --- a/plugin.manifest +++ b/plugin.manifest @@ -1,7 +1,7 @@ pluginclassname=OSKA pluginname=OSKA origin=virtUOS -version=1.0.8 +version=1.0.9 studipMinVersion=4.0 studipMaxVersion=4.6.99 category=Kommunikation und Zusammenarbeit -- GitLab