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
21namespace ILIAS\Export\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("export_files")) {
42 return;
43 }
44 $this->db->createTable("export_files", [
45 'object_id' => [
46 'type' => 'integer',
47 'length' => 8,
48 'default' => 0,
49 'notnull' => true
50 ],
51 'rid' => [
52 'type' => 'text',
53 'length' => 64,
54 'default' => '',
55 'notnull' => true
56 ],
57 'owner_id' => [
58 'type' => 'integer',
59 'length' => 8,
60 'default' => 0,
61 'notnull' => true
62 ],
63 'timestamp' => [
64 'type' => 'timestamp',
65 'notnull' => false
66 ],
67 ]);
68 $this->db->addPrimaryKey("export_files", ["object_id", "rid"]);
69 }
70
74 public function step_2(): void
75 {
76 if ($this->db->tableExists("export_public_access")) {
77 return;
78 }
79 $this->db->createTable("export_public_access", [
80 'object_id' => [
81 'type' => 'integer',
82 'length' => 8,
83 'default' => 0,
84 'notnull' => true
85 ],
86 'export_option_id' => [
87 'type' => 'text',
88 'length' => 64,
89 'default' => '',
90 'notnull' => true
91 ],
92 'identification' => [
93 'type' => 'text',
94 'length' => 64,
95 'default' => '',
96 'notnull' => true
97 ],
98 'timestamp' => [
99 'type' => 'timestamp',
100 'notnull' => false
101 ],
102 ]);
103 $this->db->addPrimaryKey("export_public_access", ["object_id"]);
104 }
105
109 public function step_3(): void
110 {
111 if (!$this->db->tableExists("export_file_info")) {
112 return;
113 }
114 if (
115 $this->db->tableColumnExists("export_file_info", "migrated")
116 ) {
117 return;
118 }
119 $this->db->addTableColumn("export_file_info", "migrated", [
120 'type' => ilDBConstants::T_INTEGER,
121 'length' => 4,
122 'default' => 0
123 ]);
124 }
125}
step_2()
Create table to store info about the public access file of an object.
step_3()
Add migrate column to table export_file_info.
step_1()
Create new export file table.
Class ilDBConstants.
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...