TokensMigration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 9 1
1
<?php
2
3
use Phpmig\Migration\Migration;
4
use Illuminate\Database\Capsule\Manager as Capsule;
5
6
class TokensMigration extends Migration
7
{
8
    /**
9
     * Do the migration
10
     */
11
    public function up()
12
    {
13
        Capsule::schema()->create('tokens', function($table)
14
        {
15
            $table->increments('id');
16
            $table->string('code', 5);
17
            $table->integer('user_id')->unsigned();
18
            $table->boolean('used')->default(false);
19
            $table->timestamps();
20
        });
21
    }
22
23
    /**
24
     * Undo the migration
25
     */
26
    public function down()
27
    {
28
        Capsule::schema()->drop('tokens');
29
    }
30
}