aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/6.0.9_notification_positioning.php
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrations/6.0.9_notification_positioning.php')
-rw-r--r--db/migrations/6.0.9_notification_positioning.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/db/migrations/6.0.9_notification_positioning.php b/db/migrations/6.0.9_notification_positioning.php
new file mode 100644
index 0000000..d6693f3
--- /dev/null
+++ b/db/migrations/6.0.9_notification_positioning.php
@@ -0,0 +1,35 @@
+<?php
+class NotificationPositioning extends Migration
+{
+ public function description()
+ {
+ return 'Adds a personal config option to select the on-screen position of system notifications';
+ }
+
+ protected function up()
+ {
+ DBManager::get()->execute(
+ "INSERT IGNORE INTO `config` VALUES (:field, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :desc)",
+ [
+ 'field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT',
+ 'value' => 'topcenter',
+ 'type' => 'string',
+ 'range' => 'user',
+ 'section' => '',
+ 'desc' => 'Wo sollen Systembenachrichtigungen im Fenster angezeigt werden? Gültige Werte sind "topcenter" und "bottomright"'
+ ]
+ );
+ }
+
+ protected function down()
+ {
+ DBManager::get()->execute(
+ "DELETE FROM `config_values` WHERE `field` = :field",
+ ['field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT']
+ );
+ DBManager::get()->execute(
+ "DELETE FROM `config` WHERE `field` = :field",
+ ['field' => 'SYSTEM_NOTIFICATIONS_PLACEMENT']
+ );
+ }
+};