diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/6.0.50_cleanup_audio_notification_settings.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/db/migrations/6.0.50_cleanup_audio_notification_settings.php b/db/migrations/6.0.50_cleanup_audio_notification_settings.php new file mode 100644 index 0000000..111a336 --- /dev/null +++ b/db/migrations/6.0.50_cleanup_audio_notification_settings.php @@ -0,0 +1,46 @@ +<?php +final class CleanupAudioNotificationSettings extends Migration +{ + public function description() + { + return 'Cleans up the automatic setting of audio notifications done in migration 6.0.22'; + } + + public function up() + { + // Delete config setting for audio notifications. + DBManager::get()->exec("DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED'"); + + // Delete all personal notifications generated by migration 6.0.22. + $texts = [ + 'Aus technischen Gründen wurde das Audio-Feedback zu Benachrichtigungen in Ihrem Konto deaktiviert. ' + . 'Bitte aktivieren Sie dieses erneut, wenn Sie es weiterhin nutzen möchten.', + 'For technical reasons, the audio feedback for notifications has been deactivated in your account. ' + . 'Please reactivate it if you wish to continue using it.' + ]; + DBManager::get()->execute( + "DELETE `personal_notifications`, `personal_notifications_user` + FROM `personal_notifications` + LEFT JOIN `personal_notifications_user` USING (`personal_notification_id`) + WHERE `text` IN (:texts);", + ['texts' => $texts] + ); + } + + public function down() + { + DBManager::get()->execute("INSERT IGNORE INTO `config` + (`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`) + VALUES (:field, :value, 'boolean', 'user', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)", + [ + ':field' => 'PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED', + ':value' => '0', + ':description' => 'Deaktiviert das Abspielen von Tönen für die persönlichen Benachrichtigungen', + ] + ); + } + +} |
