diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-04-10 16:01:39 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2025-04-10 16:01:39 +0000 |
| commit | 9eb4a969ac7760c0af0032a80ab9fcc6ddbc1d8b (patch) | |
| tree | d9b2d1babc758fa6ca412e93c1eb47b5420e8450 | |
| parent | 8753837d8daf043ad61833d11088622332c9a6c9 (diff) | |
add migration that fixes issues with migration 6.0.13, fixes #5490
Closes #5490
Merge request studip/studip!4118
| -rw-r--r-- | db/migrations/6.0.13_alter_schedule_table.php | 4 | ||||
| -rw-r--r-- | db/migrations/6.0.46_adjust_schedule_table.php | 29 |
2 files changed, 31 insertions, 2 deletions
diff --git a/db/migrations/6.0.13_alter_schedule_table.php b/db/migrations/6.0.13_alter_schedule_table.php index e65b27a..3ab1b49 100644 --- a/db/migrations/6.0.13_alter_schedule_table.php +++ b/db/migrations/6.0.13_alter_schedule_table.php @@ -30,7 +30,7 @@ class AlterScheduleTable extends Migration $db->exec( "ALTER TABLE `schedule_courses` DROP COLUMN color, - CHANGE COLUMN seminar_id course_id CHAR(32) NOT NULL, + CHANGE COLUMN seminar_id course_id CHAR(32) COLLATE latin1_bin NOT NULL, ADD COLUMN mkdate BIGINT(10) NOT NULL DEFAULT 0, ADD COLUMN chdate BIGINT(10) NOT NULL DEFAULT 0" ); @@ -43,7 +43,7 @@ class AlterScheduleTable extends Migration $db->exec( "ALTER TABLE `schedule_courses` ADD COLUMN color TINYINT(4) NULL DEFAULT NULL, - CHANGE COLUMN course_id seminar_id CHAR(32) NOT NULL, + CHANGE COLUMN course_id seminar_id CHAR(32) COLLATE latin1_bin NOT NULL, DROP COLUMN mkdate, DROP COLUMN chdate" ); diff --git a/db/migrations/6.0.46_adjust_schedule_table.php b/db/migrations/6.0.46_adjust_schedule_table.php new file mode 100644 index 0000000..8ba201c --- /dev/null +++ b/db/migrations/6.0.46_adjust_schedule_table.php @@ -0,0 +1,29 @@ +<?php +/** + * @see https://gitlab.studip.de/studip/studip/-/issues/5490 + */ +final class AdjustScheduleTable extends Migration +{ + public function description() + { + return 'Fixes problems with migration 6.0.13'; + } + + public function up() + { + $query = "ALTER TABLE `schedule_courses` + MODIFY COLUMN `course_id` CHAR(32) COLLATE latin1_bin NOT NULL, + MODIFY COLUMN `mkdate` INT(11) UNSIGNED NOT NULL DEFAULT 0, + MODIFY COLUMN `chdate` INT(11) UNSIGNED NOT NULL DEFAULT 0"; + DBManager::get()->execute($query); + } + + public function down() + { + $query = "ALTER TABLE `schedule_courses` + MODIFY COLUMN `course_id` CHAR(32) COLLATE latin1_bin NOT NULL, + MODIFY COLUMN `mkdate` BIGINT(10) NOT NULL DEFAULT 0, + MODIFY COLUMN `chdate` BIGINT(10) NOT NULL DEFAULT 0"; + DBManager::get()->execute($query); + } +} |
