ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilForumDatabaseUpdateSteps.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
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 if ($this->db->tableExists('frm_settings') && !$this->db->tableColumnExists('frm_settings', 'stylesheet')) {
33 $this->db->addTableColumn(
34 'frm_settings',
35 'stylesheet',
36 [
37 'type' => 'integer',
38 'notnull' => true,
39 'length' => 4,
40 'default' => 0
41 ]
42 );
43 }
44 }
45
46 public function step_2(): void
47 {
48 $this->db->manipulateF("UPDATE object_data SET offline = %s WHERE type = %s", ['integer', 'text'], [0, 'frm']);
49 }
50
51 public function step_3(): void
52 {
53 if (!$this->db->tableColumnExists('frm_posts', 'rcid')) {
54 $this->db->addTableColumn(
55 'frm_posts',
56 'rcid',
57 [
58 'type' => 'text',
59 'notnull' => false,
60 'length' => 64,
61 'default' => ''
62 ]
63 );
64 }
65 }
66
67 public function step_4(): void
68 {
69 if ($this->db->tableExists('frm_thread_access')) {
70 $this->db->dropTable('frm_thread_access');
71 }
72 }
73
74 public function step_5(): void
75 {
76 if ($this->db->tableExists('settings')) {
77 $this->db->manipulateF(
78 "DELETE FROM settings WHERE keyword = %s",
79 ['text'],
80 ['frm_new_deadline']
81 );
82 }
83 }
84
85 public function step_6(): void
86 {
87 if (!$this->db->tableColumnExists('frm_posts_drafts', 'rcid')) {
88 $this->db->addTableColumn(
89 'frm_posts_drafts',
90 'rcid',
91 [
92 'type' => 'text',
93 'notnull' => false,
94 'length' => 64,
95 'default' => ''
96 ]
97 );
98 }
99 }
100}
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...