ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ProgressBlockUpdateSteps11.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Tracking\Setup;
22
26
28{
29 protected ilDBInterface $db;
30
31 public function prepare(ilDBInterface $db): void
32 {
33 $this->db = $db;
34 }
35
39 public function step_1(): void
40 {
41 if ($this->db->tableExists('ut_progress_block')) {
42 return;
43 }
44 $this->db->createTable('ut_progress_block', [
45 'obj_id' => [
46 'type' => ilDBConstants::T_TEXT,
47 'length' => 4,
48 'default' => 0,
49 'notnull' => true
50 ],
51 'show_block' => [
53 'length' => 1,
54 'default' => 0,
55 'notnull' => true
56 ]
57 ]);
58 $this->db->addPrimaryKey('ut_progress_block', ['obj_id']);
59 }
60
64 public function step_2(): void
65 {
66 if (
67 !$this->db->tableExists('ut_progress_block') ||
68 !$this->db->tableColumnExists('ut_progress_block', 'obj_id')
69 ) {
70 return;
71 }
72 $this->db->modifyTableColumn(
73 'ut_progress_block',
74 'obj_id',
75 [
77 'length' => 4,
78 'default' => 0,
79 'notnull' => true
80 ]
81 );
82 }
83}
step_2()
Fix column types in progress block table.
Class ilDBConstants.
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...