Completed
Push — master ( 25c873...2076b7 )
by Afshin
02:25
created

AddHasPicToUsersTableMigration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 5 1
A down() 0 5 1
1
<?php
2
3
use Phpmig\Migration\Migration;
4
use Illuminate\Database\Capsule\Manager as Capsule;
5
6
class AddHasPicToUsersTableMigration extends Migration
7
{
8
    /**
9
     * Do the migration
10
     */
11
    public function up()
12
    {
13
        Capsule::schema()->table('users', function($table)
14
        {
15
            $table->enum('has_pic',['no','yes'])->default('no');
16
        });
17
    }
18
19
    /**
20
     * Undo the migration
21
     */
22
    public function down()
23
    {
24
        Capsule::schema()->table('users', function($table)
25
        {
26
            $table->drop('has_pic');
27
        });
28
    }
29
}