Elgg  Version 6.1
20171016113827_update_metadata_columns.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class UpdateMetadataColumns extends AbstractMigration {
10  public function up() {
11 
12  if ($this->hasTable('metadata')) {
13  $table = $this->table('metadata');
14 
15  if ($table->hasIndexByName('owner_guid')) {
16  $table->removeIndexByName('owner_guid')->save();
17  }
18  if ($table->hasIndexByName('access_id')) {
19  $table->removeIndexByName('access_id')->save();
20  }
21 
22  if ($table->hasColumn('owner_guid')) {
23  $table->changeColumn('owner_guid', 'integer', ['null' => true]);
24  }
25  if ($table->hasColumn('access_id')) {
26  $table->changeColumn('access_id', 'integer', ['null' => true]);
27  }
28 
29  $table->save();
30  }
31  }
32 }
up()
Changes metadata owner_guid, access_id and enabled column usage to allow null values Also removes own...
$table
Definition: user.php:37