ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilResourceStorageDB90 Class Reference

Class ilResourceStorageDB90. More...

+ Inheritance diagram for ilResourceStorageDB90:
+ Collaboration diagram for ilResourceStorageDB90:

Public Member Functions

 prepare (ilDBInterface $db)
 
 step_1 ()
 creates a new database table "il_resource_flavour" that is used to reference resource flavours to it's original resource. More...
 
 step_2 ()
 
 step_3 ()
 
 step_4 ()
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Member Function Documentation

◆ prepare()

ilResourceStorageDB90::prepare ( ilDBInterface  $db)

Definition at line 30 of file class.ilResourceStorageDB90.php.

30 : void
31 {
32 $this->db = $db;
33 }

References $db.

◆ step_1()

ilResourceStorageDB90::step_1 ( )

creates a new database table "il_resource_flavour" that is used to reference resource flavours to it's original resource.

Definition at line 40 of file class.ilResourceStorageDB90.php.

40 : void
41 {
42 $flavour_table = "il_resource_flavour";
43 $this->db->dropTable($flavour_table, false);
44 if ($this->db->tableExists($flavour_table)) {
45 return;
46 }
47
48 $this->db->createTable($flavour_table, [
49 'rid' => [
50 'notnull' => true,
51 'length' => '64',
52 'type' => 'text',
53 ],
54 'revision' => [
55 'notnull' => true,
56 'length' => '8',
57 'type' => 'integer',
58 ],
59 'definition_id' => [
60 'notnull' => true,
61 'length' => '64',
62 'type' => 'text',
63 ],
64 'variant' => [
65 'notnull' => false,
66 'length' => '768',
67 'type' => 'text',
68 ]
69 ]);
70
71 $this->db->addIndex($flavour_table, ['rid'], 'i1');
72 $this->db->addIndex($flavour_table, ['definition_id'], 'i3');
73 $this->db->addIndex($flavour_table, ['variant'], 'i4');
74 $this->db->addPrimaryKey($flavour_table, ['rid', 'revision', 'definition_id', 'variant']);
75 }

◆ step_2()

ilResourceStorageDB90::step_2 ( )

Definition at line 77 of file class.ilResourceStorageDB90.php.

77 : void
78 {
79 // Remove some unused indexes, since they are in primaries now
80 try {
81 $this->db->dropIndexByFields('il_resource_info', ['rid']);
82 } catch (Exception) {
83 }
84 try {
85 $this->db->dropIndexByFields('il_resource_revision', ['rid']);
86 } catch (Exception) {
87 }
88 try {
89 $this->db->dropIndexByFields('il_resource_stkh_u', ['rid']);
90 } catch (Exception) {
91 }
92 }

◆ step_3()

ilResourceStorageDB90::step_3 ( )

Definition at line 94 of file class.ilResourceStorageDB90.php.

94 : void
95 {
96 // add column rtype to il_resource
97 $this->db->addTableColumn('il_resource', 'rtype', [
98 'type' => 'integer',
99 'length' => '1',
100 'notnull' => true,
101 'default' => ResourceType::SINGLE_FILE->value
102 ]);
103 }

◆ step_4()

ilResourceStorageDB90::step_4 ( )

Definition at line 105 of file class.ilResourceStorageDB90.php.

105 : void
106 {
107 // add column rtype to il_resource
108 $this->db->addTableColumn('il_resource_revision', 'status', [
109 'type' => 'integer',
110 'length' => '2',
111 'notnull' => true,
112 'default' => RevisionStatus::PUBLISHED->value
113 ]);
114 }

Field Documentation

◆ $db

ilDBInterface ilResourceStorageDB90::$db
protected

Definition at line 28 of file class.ilResourceStorageDB90.php.

Referenced by prepare().


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