ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilStudyProgrammeSettingsTableUpdateSteps.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 {
24  public const TABLE_NAME = 'prg_settings';
25  public const TABLE_PROGRESSES = 'prg_usr_progress';
26 
27  protected ilDBInterface $db;
28 
29  public function prepare(ilDBInterface $db): void
30  {
31  $this->db = $db;
32  }
33 
34  public function step_1(): void
35  {
36  $column_name = 'vq_restart_recheck';
37 
38  if (!$this->db->tableColumnExists(self::TABLE_NAME, $column_name)) {
39  $this->db->addTableColumn(
40  self::TABLE_NAME,
41  $column_name,
42  [
43  'type' => 'integer',
44  'length' => 1,
45  'default' => 0,
46  'notnull' => false
47  ]
48  );
49  }
50  }
51 
52  public function step_2(): void
53  {
54  $this->db->dropPrimaryKey(self::TABLE_PROGRESSES);
55  $this->db->addPrimaryKey(
56  self::TABLE_PROGRESSES,
57  [
58  'assignment_id',
59  'prg_id',
60  'usr_id'
61  ]
62  );
63  }
64 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...