Elgg  Version master
20170808084728_drop_geocode_cache.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class DropGeocodeCache extends AbstractMigration {
6 
10  public function up() {
11  $this->table('geocode_cache')->drop()->save();
12  }
13 
17  public function down() {
18  $table = $this->table("geocode_cache", [
19  'engine' => "MEMORY",
20  'encoding' => "utf8mb4",
21  'collation' => "utf8mb4_general_ci",
22  ]);
23 
24  $table->addColumn('location', 'string', [
25  'null' => true,
26  'limit' => 128,
27  ]);
28 
29  $table->addColumn('lat', 'string', [
30  'null' => true,
31  'limit' => 20,
32  ]);
33 
34  $table->addColumn('long', 'string', [
35  'null' => true,
36  'limit' => 20,
37  ]);
38 
39  $table->addIndex(['location'], [
40  'name' => "location",
41  'unique' => true
42  ]);
43 
44  $table->save();
45  }
46 }
$table
Definition: user.php:37