diff options
| author | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2023-11-14 11:57:16 +0100 |
|---|---|---|
| committer | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2024-07-09 09:19:01 +0200 |
| commit | 62cc5d1f509b245159ffcbd0dbd08ab389e51615 (patch) | |
| tree | 84070ab147fdfa4ecb26767f42de7d1374a304c1 /db | |
| parent | 2aa22a3decc515ef19681e3fbb303e395bfef6d4 (diff) | |
Add Peer Review on top of feature/better-tasks.feature/peerreview-6
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.6.1_add_peer_review_tables.php | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/db/migrations/5.6.1_add_peer_review_tables.php b/db/migrations/5.6.1_add_peer_review_tables.php new file mode 100644 index 0000000..aa90435 --- /dev/null +++ b/db/migrations/5.6.1_add_peer_review_tables.php @@ -0,0 +1,56 @@ +7<?php +class AddPeerReviewTables extends Migration +{ + public function description() + { + return "TODO"; + } + + public function up() + { + $db = \DBManager::get(); + + $db->exec( + "CREATE TABLE `cw_peer_review_processes`( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `task_group_id` INT(11) NOT NULL, + `owner_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `configuration` MEDIUMTEXT NOT NULL, + `review_start` INT(11) NOT NULL, + `review_end` INT(11) NOT NULL, + `paired_at` INT(11) NULL, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + PRIMARY KEY(`id`), + INDEX index_task_group_id(`task_group_id`), + INDEX index_owner_id(`owner_id`) + )" + ); + + $db->exec( + "CREATE TABLE `cw_peer_reviews`( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `process_id` INT(11) NOT NULL, + `task_id` INT(11) NOT NULL, + `submitter_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `reviewer_id` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `reviewer_type` ENUM('autor', 'group') COLLATE latin1_bin, + `assessment` TEXT, + `mkdate` INT(11) NOT NULL, + `chdate` INT(11) NOT NULL, + PRIMARY KEY(`id`), + INDEX index_process_id(`process_id`), + INDEX index_task_id(`task_id`), + INDEX index_submitter_id(`submitter_id`), + INDEX index_reviewer_id(`reviewer_id`) + )" + ); + } + + public function down() + { + $db = \DBManager::get(); + $db->exec('DROP TABLE IF EXISTS `cw_peer_reviews`'); + $db->exec('DROP TABLE IF EXISTS `cw_peer_review_processes`'); + } +} |
