ILIAS  release_8 Revision v8.24
class.ilWikiDBUpdateSteps.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\Wiki\Setup;
20
25{
26 protected \ilDBInterface $db;
27
28 public function prepare(\ilDBInterface $db): void
29 {
30 $this->db = $db;
31 }
32
33 public function step_1(): void
34 {
35 $db = $this->db;
36 foreach (["int_links", "ext_links", "footnotes", "num_ratings", "num_words", "avg_rating", "deleted"] as $field) {
37 $db->modifyTableColumn('wiki_stat_page', $field, array(
38 'type' => 'integer',
39 'length' => 4,
40 'notnull' => true,
41 'default' => 0
42 ));
43 }
44 }
45
46 public function step_2(): void
47 {
48 $db = $this->db;
49 foreach (["num_chars"] as $field) {
50 $db->modifyTableColumn('wiki_stat_page', $field, array(
51 'type' => 'integer',
52 'length' => 8,
53 'notnull' => true,
54 'default' => 0
55 ));
56 }
57 }
58
59 public function step_3(): void
60 {
61 $db = $this->db;
62 foreach (["num_pages", "del_pages", "avg_rating"] as $field) {
63 $db->modifyTableColumn('wiki_stat', $field, array(
64 'type' => 'integer',
65 'length' => 4,
66 'notnull' => true,
67 'default' => 0
68 ));
69 }
70 }
71}
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
Interface ilDBInterface.
modifyTableColumn(string $table, string $column, array $attributes)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: class.Agent.php:19