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

AddRolesTable20210704165744   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 4 1
A up() 0 16 1
1
<?php
2
    namespace Platine\Framework\Migration;
3
4
use Platine\Database\Schema\CreateTable;
5
use Platine\Framework\Migration\AbstractMigration;
6
7
    class AddRolesTable20210704165744 extends AbstractMigration
8
    {
9
10
          public function up(): void
11
          {
12
            //Action when migrate up
13
            $this->create('roles', function (CreateTable $table) {
14
                $table->integer('id')
15
                        ->autoincrement()
16
                       ->primary();
17
                $table->string('description')
18
                       ->description('The role description');
19
                $table->datetime('created_at')
20
                        ->description('role created at')
21
                        ->notNull();
22
                $table->datetime('updated_at')
23
                        ->description('role updated at');
24
25
                $table->engine('INNODB');
26
            });
27
          }
28
29
          public function down(): void
30
          {
31
            //Action when migrate down
32
            $this->drop('roles');
33
          }
34
    }