Test Failed
Push — develop ( 8a31ce...8fcf9d )
by nguereza
02:43
created

AddUserRoleField20210720080304   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 6 1
A down() 0 5 1
1
<?php
2
3
namespace Platine\Framework\Migration;
4
5
use Platine\Database\Schema\AlterTable;
6
use Platine\Framework\Migration\AbstractMigration;
7
8
class AddUserRoleField20210720080304 extends AbstractMigration
9
{
10
11
    public function up(): void
12
    {
13
      //Action when migrate up
14
        $this->alter('users', function (AlterTable $table) {
15
            $table->string('role')
16
                 ->description('The user role or function');
17
        });
18
    }
19
20
    public function down(): void
21
    {
22
      //Action when migrate down
23
        $this->alter('users', function (AlterTable $table) {
24
             $table->dropColumn('role');
25
        });
26
    }
27
}
28