diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-05-06 11:23:37 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-05-06 12:19:24 +0200 |
| commit | 5e1cbbf723d9d6020deaef9a1e3d6b7c91b55543 (patch) | |
| tree | 6a6aaa4c8f6fd47ff35eb893351df53aeefd3710 /db/migrations | |
| parent | d058e26b1b69956de1d8333a9ca3539cfc0a73a0 (diff) | |
fix migration 5.3.30 for different stud.ip version, fixes #5569
Closes #5569
Merge request studip/studip!4192
Diffstat (limited to 'db/migrations')
| -rw-r--r-- | db/migrations/5.3.30_repair_consultation_events.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/db/migrations/5.3.30_repair_consultation_events.php b/db/migrations/5.3.30_repair_consultation_events.php index bff349f..7a8f776 100644 --- a/db/migrations/5.3.30_repair_consultation_events.php +++ b/db/migrations/5.3.30_repair_consultation_events.php @@ -4,6 +4,8 @@ */ final class RepairConsultationEvents extends Migration { + use DatabaseMigrationTrait; + protected function up() { $block_ids = $this->getBlockIds(); @@ -12,9 +14,17 @@ final class RepairConsultationEvents extends Migration return; } - $query = "DELETE `consultation_events`, `event_data` + $event_table = 'calendar_dates'; + $event_id_column = 'id'; + + if (!$this->tableExists($event_table)) { + $event_table = 'event_data'; + $event_id_column = 'event_id'; + } + + $query = "DELETE `consultation_events`, `{$event_table}` FROM `consultation_events` - LEFT JOIN `event_data` USING (`event_id`) + LEFT JOIN `{$event_table}` ON `{$event_table}`.`{$event_id_column}` = `consultation_events`.`event_id` JOIN `consultation_slots` AS s USING (`slot_id`) WHERE `block_id` IN (?) AND NOT EXISTS ( |
