Elgg  Version master
20230606155735_add_delete_columns_to_entities_tables.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
6 
7 final class AddDeleteColumnsToEntitiesTables extends AbstractMigration {
11  public function change(): void {
12  $table = $this->table('entities');
13  if (!$table->hasColumn('deleted')) {
14  $table->addColumn('deleted', 'enum', [
15  'null' => false,
16  'default' => 'no',
17  'limit' => 3,
18  'values' => [
19  'yes',
20  'no',
21  ],
22  ]);
23 
24  $table->addIndex(['deleted'], [
25  'name' => 'deleted',
26  'unique' => false,
27  ]);
28  }
29 
30  if (!$table->hasColumn('time_deleted')) {
31  $table->addColumn('time_deleted', 'integer', [
32  'null' => false,
33  'default' => '0',
34  'limit' => MysqlAdapter::INT_REGULAR,
35  'precision' => 11,
36  ]);
37 
38  $table->addIndex(['time_deleted'], [
39  'name' => 'time_deleted',
40  'unique' => false,
41  ]);
42  }
43 
44  $table->update();
45  }
46 }
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
$table
Definition: user.php:37
change()
Add the deleted and time_deleted columns to the entities table.