Passed
Push — master ( ced451...069cb4 )
by Hilmi Erdem
04:47 queued 45s
created

CreateOtpTokensTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 10 1
A down() 0 3 1
1
<?php
2
3
/*
4
 * @copyright 2018 Hilmi Erdem KEREN
5
 * @license MIT
6
 */
7
8
use Illuminate\Support\Facades\Schema;
9
use Illuminate\Database\Schema\Blueprint;
10
use Illuminate\Database\Migrations\Migration;
11
12
class CreateOtpTokensTable extends Migration
13
{
14
    /**
15
     * Run the migrations.
16
     */
17
    public function up()
18
    {
19
        Schema::create('otp_tokens', function (Blueprint $table) {
20
            $table->unsignedInteger('authenticable_id');
21
            $table->string('cipher_text', 64);
22
            $table->timestamp('created_at')->useCurrent();
23
            $table->timestamp('updated_at')->useCurrent();
24
            $table->unsignedSmallInteger('expiry_time')->nullable();
25
26
            $table->unique(['authenticatable_id', 'cipher_text']);
27
        });
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     */
33
    public function down()
34
    {
35
        Schema::drop('otp_tokens');
36
    }
37
}
38