Completed
Push — master ( 3d9eaa...7212f9 )
by Stephen
35:45
created

CreateLevelsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateLevelsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('levels', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->string('name')->unique();
19
            $table->string('label')->nullable();
20
            $table->text('description')->nullable();
21
            $table->integer('rank')->unsigned();
22
            $table->timestamps();
23
24
            $table->index('name');
25
            $table->index('rank');
26
        });
27
    }
28
29
    /**
30
     * Reverse the migrations.
31
     *
32
     * @return void
33
     */
34
    public function down()
35
    {
36
        Schema::dropIfExists('levels');
37
    }
38
}
39