diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.5.15_step3344_ilias_results.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/db/migrations/5.5.15_step3344_ilias_results.php b/db/migrations/5.5.15_step3344_ilias_results.php new file mode 100644 index 0000000..20bb33a --- /dev/null +++ b/db/migrations/5.5.15_step3344_ilias_results.php @@ -0,0 +1,32 @@ +<?php +require_once 'lib/cronjobs/import_ilias_testresults.php'; +final class Step3344IliasResults extends Migration +{ + + use DatabaseMigrationTrait; + + public function description() + { + return 'adds column passed to table `grading_instances`, add cronjob'; + } + + protected function up() + { + if (!$this->columnExists('grading_instances', 'passed')) { + DBManager::get()->exec("ALTER TABLE `grading_instances` ADD + `passed` TINYINT NOT NULL DEFAULT 0 AFTER `feedback`"); + + } + ImportIliasTestresults::register()->schedulePeriodic(45, 1); + } + + protected function down() + { + if ($this->columnExists('grading_instances', 'passed')) { + DBManager::get()->exec("ALTER TABLE `grading_instances` DROP + `passed`"); + } + ImportIliasTestresults::unregister(); + } + +} |
