aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2025-03-10 11:19:20 +0000
committerThomas Hackl <hackl@data-quest.de>2025-03-10 11:19:20 +0000
commita1f81c709937ec086c9c38ab0d08ae9e044d1ef5 (patch)
tree5cc11caebafcac6f9cb85318104fd2f3057ca0ad /db
parent7403c2be52ab969899bc9171fdba7c49c6deff89 (diff)
Resolve "check_admission Cronjob kaputt"
Closes #5269 Merge request studip/studip!4037
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.0.45_add_userfilter_namespaces.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/db/migrations/6.0.45_add_userfilter_namespaces.php b/db/migrations/6.0.45_add_userfilter_namespaces.php
new file mode 100644
index 0000000..bb6de8e
--- /dev/null
+++ b/db/migrations/6.0.45_add_userfilter_namespaces.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * Adds namespace values to UserFilter database entries that already existed pre-6.0.
+ */
+final class AddUserfilterNamespaces extends Migration
+{
+
+ public function description()
+ {
+ return 'Add namesspaces to existing UserFilter database entries';
+ }
+
+ public function up()
+ {
+ $types = [
+ 'DegreeCondition',
+ 'PermissionCondition',
+ 'SemesterOfStudyCondition',
+ 'StgteilVersionCondition',
+ 'SubjectCondition',
+ 'SubjectConditionAny'
+ ];
+
+ DBManager::get()->execute(
+ "UPDATE `userfilter_fields`
+ SET `type` = CONCAT('UserFilterFields\\\', `type`)
+ WHERE `type` IN (:types)",
+ ['types' => $types]
+ );
+
+ // Special handling for datafield entries which have an ID appended to the type name:
+ DBManager::get()->execute(
+ "UPDATE `userfilter_fields`
+ SET `type` = CONCAT('UserFilterFields\\\', `type`)
+ WHERE `type` LIKE :type",
+ ['type' => 'DatafieldCondition_%']
+ );
+ }
+}