diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-06-26 14:55:40 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-06-27 09:49:30 +0200 |
| commit | 3e597cc740ef156d24e3f78dd87c583a96774e91 (patch) | |
| tree | 341d45b9806134a3ba401c0cec9be498cba426c8 /db | |
| parent | 441375b8915716cfff6b5976e3588fdab0666f0b (diff) | |
add index and set correct for auth_user_md5.matriculation_number, fixes #4577
Closes #4577
Merge request studip/studip!3392
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.5.32_index_and_correct_type_for_matriculation_number.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/db/migrations/5.5.32_index_and_correct_type_for_matriculation_number.php b/db/migrations/5.5.32_index_and_correct_type_for_matriculation_number.php new file mode 100644 index 0000000..e74ff6d --- /dev/null +++ b/db/migrations/5.5.32_index_and_correct_type_for_matriculation_number.php @@ -0,0 +1,27 @@ +<?php +/** + * @see https://gitlab.studip.de/studip/studip/-/issues/4577 + */ +final class IndexAndCorrectTypeForMatriculationNumber extends Migration +{ + public function description() + { + return 'Sets the type of the matriculation number column correctly and adds an index'; + } + + public function up() + { + $query = "ALTER TABLE `auth_user_md5` + MODIFY COLUMN `matriculation_number` VARCHAR(255) COLLATE latin1_bin NULL DEFAULT NULL, + ADD UNIQUE INDEX `matriculation_number` (`matriculation_number`)"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "ALTER TABLE `auth_user_md5` + DROP INDEX `matriculation_number`, + MODIFY COLUMN `matriculation_number` VARCHAR(255) NULL DEFAULT NULL"; + DBManager::get()->exec($query); + } +} |
