aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorMurtaza Sultani <sultani@data-quest.de>2025-11-20 15:15:16 +0100
committerMurtaza Sultani <sultani@data-quest.de>2025-11-20 15:15:16 +0100
commit4c10ca495c20c3f2a07841c54fbd1888b2dbac28 (patch)
treea8daaaa18b6902098365b625fff48a14688fec51 /db
parent091e85611b2bc83d8d760bcd209dcc7306c85dae (diff)
Resolve "Zielgruppenspezifische Startseitenwidgets"
Closes #4756 Merge request studip/studip!3696
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.1.17_step_4756.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/db/migrations/6.1.17_step_4756.php b/db/migrations/6.1.17_step_4756.php
new file mode 100644
index 0000000..fa9abcb
--- /dev/null
+++ b/db/migrations/6.1.17_step_4756.php
@@ -0,0 +1,53 @@
+<?php
+
+return new class extends Migration
+{
+ public function description()
+ {
+ return 'Zielgruppenspezifische Startseitenwidgets';
+ }
+
+ protected function up()
+ {
+ DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `masswidget` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `name` VARCHAR(255) NOT NULL,
+ `author_id` CHAR(32) COLLATE latin1_bin NOT NULL,
+ `target` ENUM('all', 'students', 'employees', 'lecturers', 'courses', 'usernames') COLLATE latin1_bin,
+ `settings` LONGTEXT,
+ `exclude_users` LONGTEXT,
+ `plugin_id` INT UNSIGNED NOT NULL,
+ `row` TINYINT UNSIGNED DEFAULT 0,
+ `col` TINYINT UNSIGNED DEFAULT 0,
+ `mkdate` INT UNSIGNED NOT NULL,
+ `chdate` INT UNSIGNED NOT NULL,
+ PRIMARY KEY (`id`),
+ INDEX author_id (`author_id`)
+ )");
+
+ DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `masswidget_filter` (
+ `masswidget_id` INT NOT NULL,
+ `filter_id` CHAR(32) COLLATE latin1_bin NOT NULL,
+ `mkdate` INT UNSIGNED NOT NULL,
+ PRIMARY KEY (`masswidget_id`, `filter_id`),
+ INDEX filter_id (`filter_id`)
+ )");
+
+ DBManager::get()->exec("ALTER TABLE `widget_user`
+ ADD COLUMN `is_active` TINYINT(1) UNSIGNED DEFAULT 1,
+ ADD COLUMN `chdate` INT UNSIGNED NOT NULL");
+ }
+
+ protected function down()
+ {
+ DBManager::get()->exec("
+ DROP TABLE IF EXISTS
+ `masswidget_filter`,
+ `masswidget`
+ ");
+
+ DBManager::get()->exec("ALTER TABLE `widget_user`
+ DROP COLUMN `is_active`,
+ DROP COLUMN `chdate`");
+ }
+};