diff options
| author | André Noack <noack@data-quest.de> | 2024-03-25 15:09:39 +0000 |
|---|---|---|
| committer | André Noack <noack@data-quest.de> | 2024-03-25 15:09:39 +0000 |
| commit | fe0b89903289f69eb0a99dd553ccc28880435f1e (patch) | |
| tree | 4fd5bda29de6048a69a5d29120227b24be0fc9a9 /db | |
| parent | bf57b4bbb8f84a9c49f94c1de866e0e07cf05050 (diff) | |
Resolve #3893 "Performance des persönlichen Kalenders / Gruppenkalender ist schlecht"
Closes #3893
Merge request studip/studip!2746
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.5.28_biest3893_performance_calendar.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/db/migrations/5.5.28_biest3893_performance_calendar.php b/db/migrations/5.5.28_biest3893_performance_calendar.php new file mode 100644 index 0000000..82a86fe --- /dev/null +++ b/db/migrations/5.5.28_biest3893_performance_calendar.php @@ -0,0 +1,25 @@ +<?php + +final class Biest3893PerformanceCalendar extends Migration +{ + public function description() + { + return 'add index to calendar tables'; + } + + public function up() + { + $db = DBManager::get(); + $db->exec("DELETE FROM `calendar_date_exceptions` WHERE `date` = '1970-01-01'"); + $db->exec("ALTER TABLE `calendar_date_exceptions` ADD INDEX(`calendar_date_id`)"); + $db->exec("ALTER TABLE `calendar_dates` ADD INDEX `repetition_type` (`repetition_type`, `repetition_end`)"); + $db->exec("ALTER TABLE `calendar_dates` ADD INDEX `begin` (`begin`)"); + try { + $db->exec("ALTER TABLE `calendar_dates` DROP INDEX `uid`"); + } catch (PDOException $exception) {} + } + + public function down() + { + } +} |
