Passed
Push — master ( 39e5a8...610dd1 )
by Yaroslav
03:43
created

MigrationHelper::geonamesDefaultColumns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 21
CRAP Score 1

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