Completed
Push — master ( 08d484...c4d057 )
by ARCANEDEV
06:15
created

CreateTrackerGeoipTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 17
nc 1
nop 0
1
<?php
2
3
use Arcanedev\LaravelTracker\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreateTrackerGeoipTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateTrackerGeoipTable extends Migration
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Properties
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * The table name.
19
     *
20
     * @var string
21
     */
22
    protected $table = 'geoip';
23
24
    /* ------------------------------------------------------------------------------------------------
25
     |  Main Functions
26
     | ------------------------------------------------------------------------------------------------
27
     */
28
    /**
29
     * Migrate to database.
30
     */
31
    public function up()
32
    {
33
        $this->createSchema(function (Blueprint $table) {
34
            $table->bigIncrements('id');
35
            $table->double('latitude')->nullable()->index();
36
            $table->double('longitude')->nullable()->index();
37
            $table->string('country_code', 2)->nullable()->index();
38
            $table->string('country_code3', 3)->nullable()->index();
39
            $table->string('country_name')->nullable()->index();
40
            $table->string('region', 2)->nullable();
41
            $table->string('city', 50)->nullable()->index();
42
            $table->string('postal_code', 20)->nullable();
43
            $table->bigInteger('area_code')->nullable();
44
            $table->double('dma_code')->nullable();
45
            $table->double('metro_code')->nullable();
46
            $table->string('continent_code', 2)->nullable();
47
            $table->timestamp('created_at')->index();
48
            $table->timestamp('updated_at')->index();
49
        });
50
    }
51
}
52