UsersMigration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 4
Bugs 2 Features 0
Metric Value
c 4
b 2
f 0
dl 0
loc 27
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 13 1
1
<?php
2
3
use Phpmig\Migration\Migration;
4
use Illuminate\Database\Capsule\Manager as Capsule;
5
6
class UsersMigration extends Migration
7
{
8
    /**
9
     * Do the migration
10
     */
11
    public function up()
12
    {
13
        Capsule::schema()->create('users', function($table)
14
        {
15
            $table->increments('id');
16
            $table->string('first_name');
17
            $table->string('last_name');
18
            $table->string('username')->unique()->nullable();
19
            $table->string('mobile')->unique();
20
            $table->string('email')->unique()->nullable();
21
            $table->string('api_token');
22
            $table->rememberToken();
23
            $table->timestamps();
24
        });
25
    }
26
27
    /**
28
     * Undo the migration
29
     */
30
    public function down()
31
    {
32
        Capsule::schema()->drop('users');
33
    }
34
}