ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TodoDBUpdateSteps.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
27{
28 protected ilDBInterface $db;
29
34 public function prepare(ilDBInterface $db): void
35 {
36 $this->db = $db;
37 }
38
44 public function step_1()
45 {
46 if (! $this->db->tableExists('todo_items')) {
47 $this->db->createTable('todo_items', [
48 'todo_id' => ['type' => 'integer', 'length' => '4', 'notnull' => true],
49 'user_id' => ['type' => 'integer', 'length' => '4', 'notnull' => true],
50 'title' => ['type' => 'text', 'length' => '250', 'notnull' => true],
51 'description' => ['type' => 'clob', 'notnull' => false],
52 'deadline' => ['type' => 'date', 'notnull' => false],
53 ]);
54
55 $this->db->createSequence('todo_items');
56 $this->db->addPrimaryKey('todo_items', ['todo_id']);
57 $this->db->addIndex('todo_items', ['user_id'], 'i1');
58 }
59 }
60}
prepare(ilDBInterface $db)
Prepare the update ilDBInterface should be the only dependency of the update steps.
step_1()
Step 1: Creation of the table Update steps must be consecutively numbered ILIAS setup remembers the a...
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...