ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.DBUpdateSteps10.php
Go to the documentation of this file.
1<?php
2
20
22use ILIAS\Setup;
23
25{
26 private \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 if (!$this->db->tableColumnExists('adv_mdf_enum', 'position')) {
36 $field_infos = [
37 'type' => 'integer',
38 'length' => 4,
39 'notnull' => false,
40 'default' => null
41 ];
42 $this->db->addTableColumn('adv_mdf_enum', 'position', $field_infos);
43 }
44 }
45
46 public function step_2(): void
47 {
48 $table_name = "adv_md_record_files";
49 if ($this->db->tableExists($table_name)) {
50 return;
51 }
52 $this->db->createTable($table_name, [
53 'object_id' => [
55 'length' => 8,
56 'default' => 0,
57 'notnull' => true
58 ],
59 'rid' => [
60 'type' => ilDBConstants::T_TEXT,
61 'length' => 64,
62 'default' => '',
63 'notnull' => true
64 ],
65 'is_global' => [
67 'length' => 1,
68 'default' => 0,
69 'notnull' => true
70 ]
71 ]);
72 $this->db->addPrimaryKey($table_name, ["object_id", "rid", "is_global"]);
73 }
74}
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
Class ilDBConstants.
Interface ilDBInterface.
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...