Test Failed
Push — master ( 8c8503...dfefa4 )
by Yaroslav
03:40
created

MigrationHelper::geonamesDefaultColumns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 20
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 23
ccs 0
cts 21
cp 0
crap 2
rs 9.6
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
    public static function geonamesDefaultColumns(Blueprint $table): void
14
    {
15
        $table->unsignedInteger('geoname_id');
16
        $table->string('name', 200)->nullable()->index();
17
        $table->string('ascii_name', 200)->nullable()->index();
18
        $table->text('alternate_names')->nullable();
19
        $table->decimal('lat', 10, 7)->nullable()->index();
20
        $table->decimal('lng', 10, 7)->nullable()->index();
21
        $table->char('fclass', 1)->nullable()->index();
22
        $table->string('fcode', 10)->nullable()->index();
23
        $table->string('country', 2)->nullable()->index();
24
        $table->string('cc2', 200)->nullable()->index();
25
        $table->string('admin1', 20)->nullable()->index();
26
        $table->string('admin2', 80)->nullable()->index();
27
        $table->string('admin3', 20)->nullable()->index();
28
        $table->string('admin4', 20)->nullable()->index();
29
        $table->unsignedInteger('population')->nullable()->index();
30
        $table->integer('elevation')->nullable()->index();
31
        $table->integer('gtopo30')->nullable()->index();
32
        $table->string('timezone', 40)->nullable()->index();
33
        $table->dateTime('moddate')->nullable()->index();
34
35
        $table->primary('geoname_id');
36
    }
37
}
38