CreateTrackerAgentsTable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 34
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 13 1
1
<?php
2
3
use Arcanedev\LaravelTracker\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreateTrackerAgentsTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateTrackerAgentsTable extends Migration
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Properties
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * The table name.
19
     *
20
     * @var string
21
     */
22
    protected $table = 'agents';
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->string('name');
36
            $table->string('browser')->index();
37
            $table->string('browser_version');
38
            $table->timestamp('created_at')->index();
39
            $table->timestamp('updated_at')->index();
40
41
            $table->unique('name');
42
        });
43
    }
44
}
45