aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/5.2.5_drop_cronjobs_escalation.php
blob: 848eddd4bf32e2589e2d0a39aee40a01ec534c2b (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
25
26
27
28
29
30
31
<?php

class DropCronjobsEscalation extends Migration
{
    public function description()
    {
        return 'Drop CRONJOBS_ESCALATION system setting';
    }

    public function up()
    {
        $query = "DELETE `config`, `config_values`
                  FROM `config` LEFT JOIN `config_values` USING (`field`)
                  WHERE `field` = 'CRONJOBS_ESCALATION'";
        DBManager::get()->exec($query);
    }

    public function down()
    {
        $query = 'INSERT INTO `config` (`field`, `value`, `type`, `section`, `mkdate`, `chdate`, `description`)
                  VALUES (:name, :value, :type, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)';
        $statement = DBManager::get()->prepare($query);
        $statement->execute([
            ':name'        => 'CRONJOBS_ESCALATION',
            ':description' => 'Gibt an, nach wievielen Sekunden ein Cronjob als steckengeblieben angesehen wird',
            ':section'     => 'global',
            ':type'        => 'integer',
            ':value'       => '300'
        ]);
    }
}