1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace LaraGeoData\Database; |
4
|
|
|
|
5
|
|
|
use Illuminate\Database\Schema\Blueprint; |
6
|
|
|
|
7
|
|
|
class MigrationHelper |
8
|
|
|
{ |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @param Blueprint $table |
12
|
|
|
*/ |
13
|
1 |
|
public static function geonamesDefaultColumns(Blueprint $table): void |
14
|
|
|
{ |
15
|
1 |
|
$table->unsignedInteger('id'); |
16
|
1 |
|
$table->string('name', 200)->nullable()->index(); |
17
|
1 |
|
$table->string('ascii_name', 200)->nullable()->index(); |
18
|
1 |
|
$table->text('alternate_names')->nullable(); |
19
|
1 |
|
$table->decimal('lat', 10, 7)->nullable()->index(); |
20
|
1 |
|
$table->decimal('lng', 10, 7)->nullable()->index(); |
21
|
1 |
|
$table->char('fclass', 1)->nullable()->index(); |
22
|
1 |
|
$table->string('fcode', 10)->nullable()->index(); |
23
|
1 |
|
$table->string('country', 2)->nullable()->index(); |
24
|
1 |
|
$table->string('cc2', 200)->nullable()->index(); |
25
|
1 |
|
$table->string('admin1', 20)->nullable()->index(); |
26
|
1 |
|
$table->string('admin2', 80)->nullable()->index(); |
27
|
1 |
|
$table->string('admin3', 20)->nullable()->index(); |
28
|
1 |
|
$table->string('admin4', 20)->nullable()->index(); |
29
|
1 |
|
$table->unsignedInteger('population')->nullable()->index(); |
30
|
1 |
|
$table->integer('elevation')->nullable()->index(); |
31
|
1 |
|
$table->integer('gtopo30')->nullable()->index(); |
32
|
1 |
|
$table->string('timezone', 40)->nullable()->index(); |
33
|
1 |
|
$table->dateTime('moddate', 40)->nullable()->index(); |
34
|
|
|
|
35
|
1 |
|
$table->primary('geonameid'); |
36
|
1 |
|
} |
37
|
|
|
} |
38
|
|
|
|