ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DBUpdateSteps10.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
28{
29 protected ilDBInterface $db;
30
31 public function prepare(ilDBInterface $db): void
32 {
33 $this->db = $db;
34 }
35
36 public function step_1(): void
37 {
38 if ($this->db->tableExists("il_poll_image")) {
39 return;
40 }
41 $this->db->createTable("il_poll_image", [
42 'object_id' => [
44 'length' => 8,
45 'default' => 0,
46 'notnull' => true
47 ],
48 'rid' => [
49 'type' => ilDBConstants::T_TEXT,
50 'length' => 64,
51 'default' => '',
52 'notnull' => true
53 ]
54 ]);
55 $this->db->addPrimaryKey("il_poll_image", ["object_id"]);
56 }
57
58 public function step_2(): void
59 {
60 if (
61 !$this->db->tableExists("il_poll") or
62 $this->db->tableColumnExists("il_poll", "migrated")
63 ) {
64 return;
65 }
66 $this->db->addTableColumn("il_poll", "migrated", [
68 'length' => 4,
69 'default' => 0
70 ]);
71 }
72}
Class ilDBConstants.
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...