Test Failed
Push — develop ( 815500...0204ba )
by nguereza
02:34
created

AddRoleCode20210704170839::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
    namespace Platine\Framework\Migration;
3
4
use Platine\Database\Schema\AlterTable;
5
use Platine\Framework\Migration\AbstractMigration;
6
7
    class AddRoleCode20210704170839 extends AbstractMigration
8
    {
9
10
          public function up(): void
11
          {
12
            //Action when migrate up
13
            $this->alter('roles', function (AlterTable $table) {
14
                $table->string('code')->notNull();
15
                $table->unique('code');
16
            });
17
          }
18
19
          public function down(): void
20
          {
21
            //Action when migrate down
22
            $this->alter('roles', function (AlterTable $table) {
23
                $table->dropColumn('code');
24
            });
25
          }
26
    }