Elgg  Version master
20200130161435_remove_metadata_columns.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class RemoveMetadataColumns extends AbstractMigration
6 {
10  public function change() {
11 
12  if ($this->hasTable('metadata')) {
13  $table = $this->table('metadata');
14 
15  if ($table->hasColumn('access_id')) {
16  $table->removeColumn('access_id');
17  }
18 
19  if ($table->hasColumn('owner_guid')) {
20  $table->removeColumn('owner_guid');
21  }
22 
23  if ($table->hasColumn('enabled')) {
24  $table->removeColumn('enabled');
25  }
26 
27  $table->save();
28  }
29  }
30 }
change()
Removes obsolete columns from metadata table.
$table
Definition: user.php:37