Elgg  Version 6.1
20171021111005_add_subtype_index_to_river_table.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class AddSubtypeIndexToRiverTable extends AbstractMigration {
9  public function change() {
10 
11  $table = $this->table('river');
12 
13  if (!$table->hasIndexByName('subtype')) {
14  $table->addIndex(['subtype'], [
15  'name' => "subtype",
16  'unique' => false,
17  ]);
18 
19  $table->save();
20  }
21  }
22 }
$table
Definition: user.php:37
change()
Adds &#39;subtype&#39; as index to the river table.