ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\components\TodoExample\Setup\TodoDBUpdateSteps Class Reference
+ Inheritance diagram for ILIAS\components\TodoExample\Setup\TodoDBUpdateSteps:
+ Collaboration diagram for ILIAS\components\TodoExample\Setup\TodoDBUpdateSteps:

Public Member Functions

 prepare (ilDBInterface $db)
 Prepare the update ilDBInterface should be the only dependency of the update steps. More...
 
 step_1 ()
 Step 1: Creation of the table Update steps must be consecutively numbered ILIAS setup remembers the already executed steps. More...
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 26 of file TodoDBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ILIAS\components\TodoExample\Setup\TodoDBUpdateSteps::prepare ( ilDBInterface  $db)

Prepare the update ilDBInterface should be the only dependency of the update steps.

Definition at line 34 of file TodoDBUpdateSteps.php.

References ILIAS\components\TodoExample\Setup\TodoDBUpdateSteps\$db.

34  : void
35  {
36  $this->db = $db;
37  }

◆ step_1()

ILIAS\components\TodoExample\Setup\TodoDBUpdateSteps::step_1 ( )

Step 1: Creation of the table Update steps must be consecutively numbered ILIAS setup remembers the already executed steps.

Definition at line 44 of file TodoDBUpdateSteps.php.

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  }

Field Documentation

◆ $db

ilDBInterface ILIAS\components\TodoExample\Setup\TodoDBUpdateSteps::$db
protected

The documentation for this class was generated from the following file: