ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilBadgeDBUpdateSteps.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 
30  public function step_1(): void
31  {
32  if (!$this->db->tableColumnExists('badge_badge', 'image_rid')) {
33  $this->db->addTableColumn(
34  'badge_badge',
35  'image_rid',
36  [
37  'type' => 'text',
38  'length' => 64,
39  'notnull' => false,
40  'default' => '',
41  ]
42  );
43  }
44  }
45 
46  public function step_2(): void
47  {
48  if (!$this->db->tableColumnExists('badge_image_template', 'image_rid')) {
49  $this->db->addTableColumn(
50  'badge_image_template',
51  'image_rid',
52  [
53  'type' => 'text',
54  'length' => 64,
55  'notnull' => false,
56  'default' => '',
57  ]
58  );
59  }
60  }
61 }