aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/5.1.54_fix_single_date_logging.php
blob: d35c20ae5efa45c8625802c5026967425913fc59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

final class FixSingleDateLogging extends Migration
{
    public function description()
    {
        return 'Fix broken SingleDate-Logging';
    }

    public function up()
    {
        DBManager::get()->exec("UPDATE `log_actions` SET `info_template`= '%user hat in %sem(%affected) den Einzeltermin %singledate(%coaffected) geändert.' WHERE `name` = 'SINGLEDATE_CHANGE_TIME'");
        DBManager::get()->exec("UPDATE `log_actions` SET `info_template`= '%user hat in %sem(%affected) den Einzeltermin %singledate(%coaffected) hinzugefügt' WHERE `name` = 'SEM_ADD_SINGLEDATE'");

        DBManager::get()->exec("
            UPDATE `log_events`
            SET `dbg_info` = `info`, `info` = `coaffected_range_id`, `coaffected_range_id` = null
            WHERE `action_id` IN (
                SELECT `action_id` FROM `log_actions` WHERE `name` IN ('SINGLEDATE_CHANGE_TIME', 'SEM_ADD_SINGLEDATE')
            )
        ");
    }

}