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
32
33
34
35
36
37
38
|
<?php
final class AddPersonalNotificationConfigurations extends Migration
{
public function description()
{
return 'Adds missing configurations for "PERSONAL_NOTIFICATIONS_DEACTIVATED" and "PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED"';
}
protected function up()
{
$query = "INSERT IGNORE INTO `config`
(`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`)
VALUES (:field, :value, 'boolean', 'user', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)";
$statement = DBManager::get()->prepare($query);
$statement->execute([
':field' => 'PERSONAL_NOTIFICATIONS_DEACTIVATED',
':value' => '0',
':description' => 'Deaktiviert die persönlichen Benachrichtigungen',
]);
$statement->execute([
':field' => 'PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED',
':value' => '0',
':description' => 'Deaktiviert das Abspielen von Tönen für die persönlichen Benachrichtigungen',
]);
}
protected function down()
{
$query = "DELETE FROM `config`
WHERE `field` IN (
'PERSONAL_NOTIFICATIONS_DEACTIVATED',
'PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED'
)";
DBManager::get()->execute($query);
}
}
|