Test Failed
Push — develop ( 0204ba...bd77d0 )
by nguereza
03:38
created

AddRolesTable20210705065247::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
namespace Platine\Framework\Migration;
3
4
use Platine\Database\Schema\CreateTable;
5
use Platine\Framework\Migration\AbstractMigration;
6
7
class AddRolesTable20210705065247 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
}