CreateOtpTokensTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 10
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * @copyright 2018 Hilmi Erdem KEREN
5
 * @license MIT
6
 */
7
8
use Illuminate\Database\Migrations\Migration;
9
use Illuminate\Database\Schema\Blueprint;
10
use Illuminate\Support\Facades\Schema;
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(['authenticable_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