ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLearningSequenceRectifyPostConditionsTableDBUpdateSteps.php
Go to the documentation of this file.
1<?php
2
20{
21 private const TABLE_NAME = "post_conditions";
22
23 protected \ilDBInterface $db;
24
25 public function prepare(\ilDBInterface $db): void
26 {
27 $this->db = $db;
28 }
29
30 public function step_1(): void
31 {
32 $this->db->dropPrimaryKey(self::TABLE_NAME);
33 $this->db->addPrimaryKey(self::TABLE_NAME, ["ref_id"]);
34 }
35
36 public function step_2(): void
37 {
38 $this->db->modifyTableColumn(
39 self::TABLE_NAME,
40 "value",
41 [
42 "type" => "text",
43 "length" => 255,
44 "notnull" => false
45 ]
46 );
47 }
48
49 public function step_3(): void
50 {
51 $this->db->manipulate(
52 "UPDATE " . self::TABLE_NAME . " SET value = NULL WHERE value = 0"
53 );
54 }
55}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...