aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorRon Lucke <lucke@elan-ev.de>2024-11-21 11:33:05 +0000
committerRon Lucke <lucke@elan-ev.de>2024-11-21 11:33:05 +0000
commit9d0f6b82f35c9403a30db9ff5680f7bb8840bd63 (patch)
tree67d6c0c43a53ab341022c71f6da5c5083904e0e1 /db
parent85e59c4ee2653ac0e7c97411a7651d4965a1957a (diff)
New Login Layout (#4205)
Closes #4205 Merge request studip/studip!3192
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.0.31_add_login_news_config.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/db/migrations/6.0.31_add_login_news_config.php b/db/migrations/6.0.31_add_login_news_config.php
new file mode 100644
index 0000000..cd234eb
--- /dev/null
+++ b/db/migrations/6.0.31_add_login_news_config.php
@@ -0,0 +1,39 @@
+<?php
+
+final class AddLoginNewsConfig extends Migration
+{
+ public function description()
+ {
+ return 'Add configs for login news';
+ }
+
+ public function up()
+ {
+ $query = 'INSERT INTO `config` (`field`, `value`, `type`, `section`, `range`, `description`, `mkdate`, `chdate`)
+ VALUES (:name, :value, :type, :section, :range, :description, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())';
+ $statement = DBManager::get()->prepare($query);
+ $statement->execute([
+ 'name' => 'LOGIN_NEWS_VISIBILITY',
+ 'value' => '1',
+ 'type' => 'boolean',
+ 'section' => 'Loginseite',
+ 'range' => 'global',
+ 'description' => 'Soll Ankündigungs-Galerie auf der Loginseite sichtbar sein?'
+ ]);
+ }
+
+ public function down()
+ {
+ $query = "DELETE `config`, `config_values`, `i18n`
+ FROM `config`
+ LEFT JOIN `config_values` USING (`field`)
+ LEFT JOIN `i18n`
+ ON `table` = 'config'
+ AND `field` = 'value'
+ AND `object_id` = MD5(`config`.`field`)
+ WHERE `field` IN (
+ 'LOGIN_NEWS_VISIBILITY'
+ )";
+ DBManager::get()->exec($query);
+ }
+} \ No newline at end of file