ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
class.ilMDUpdateSteps10.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  protected \ilDBInterface $db;
24 
25  public function prepare(\ilDBInterface $db): void
26  {
27  $this->db = $db;
28  }
29 
33  public function step_1(): void
34  {
35  if (!$this->db->tableExists('il_meta_oer_exposed')) {
36  $this->db->createTable(
37  'il_meta_oer_exposed',
38  [
39  'obj_id' => [
40  'type' => ilDBConstants::T_INTEGER,
41  'notnull' => true,
42  'length' => 4
43  ],
44  'identifier' => [
45  'type' => ilDBConstants::T_TEXT,
46  'notnull' => true,
47  'length' => 64
48  ],
49  'datestamp' => [
50  'type' => ilDBConstants::T_INTEGER,
51  'notnull' => true,
52  'length' => 8
53  ],
54  'metadata' => [
55  'type' => ilDBConstants::T_CLOB,
56  'notnull' => true
57  ]
58  ]
59  );
60  $this->db->addPrimaryKey('il_meta_oer_exposed', ['obj_id']);
61  }
62  }
63 }
step_1()
Add a new table for exposed OER metadata.
prepare(\ilDBInterface $db)
Prepare the execution of the steps.