diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-10-30 12:50:28 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2024-10-30 12:50:28 +0000 |
| commit | 5c78fc761d7afd7aafd21f521ac19a15b59facf3 (patch) | |
| tree | f01420d3cc96e166206caae29360534f904e4ca5 /db | |
| parent | 363c78feaae65f3dfaba40b39463e2f1156048d4 (diff) | |
refactor holiday() function into Holidays class, allowing ids for holidays and...
Closes #2795
Merge request studip/studip!1904
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/6.0.26_add_customized_holidays_configuration.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/db/migrations/6.0.26_add_customized_holidays_configuration.php b/db/migrations/6.0.26_add_customized_holidays_configuration.php new file mode 100644 index 0000000..cb21301 --- /dev/null +++ b/db/migrations/6.0.26_add_customized_holidays_configuration.php @@ -0,0 +1,35 @@ +<?php + +/** + * @see https://gitlab.studip.de/studip/studip/-/issues/2795 + */ +final class AddCustomizedHolidaysConfiguration extends Migration +{ + public function description() + { + return 'Adds a confiugration for customized holidays'; + } + + protected function up() + { + $query = "INSERT INTO `config` ( + `field`, `value`, `type`, `range`, `section`, + `mkdate`, `chdate`, + `description` + ) VALUES ( + 'CUSTOMIZED_HOLIDAYS', '[]', 'array', 'global', 'global', + UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), + 'Speichert die internen Ids von Feiertagen, die als gesetztlich markiert werden sollen' + )"; + DBManager::get()->exec($query); + } + + protected function down() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'CUSTOMIZED_HOLIDAYS'"; + DBManager::get()->exec($query); + } +} |
