CreateProvidersTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 20 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateProvidersTable extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create(
16
            'providers', function (Blueprint $table) {
17
18
                // Set the storage engine and primary key
19
                $table->engine = 'InnoDB';
20
                $table->increments('id');
21
22
                // Ordinary columns
23
                $table->string('name')->unique();
24
                $table->string('slug')->unique();
25
                $table->unsignedInteger('login_count')->default(0);
26
27
                // Automatic columns
28
                $table->timestamps();
29
                $table->softDeletes();
30
            }
31
        );
32
    }
33
34
    /**
35
     * Reverse the migrations.
36
     *
37
     * @return void
38
     */
39
    public function down()
40
    {
41
        Schema::dropIfExists('providers');
42
    }
43
}
44