Test Failed
Push — develop ( bd77d0...12e168 )
by nguereza
03:10
created

AddConfigTable20210708043103   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 34 1
A down() 0 4 1
1
<?php
2
namespace Platine\Framework\Migration;
3
4
use Platine\Database\Schema\CreateTable;
5
use Platine\Framework\Migration\AbstractMigration;
6
7
class AddConfigTable20210708043103 extends AbstractMigration
8
{
9
10
    public function up(): void
11
    {
12
      //Action when migrate up
13
      $this->create('config', function (CreateTable $table) {
14
          $table->integer('id')
15
                  ->autoincrement()
16
                 ->primary();
17
          $table->string('env')
18
                 ->description('The config environment')
19
                 ->index();
20
          $table->string('module')
21
                 ->description('The module')
22
                 ->index();
23
          $table->string('code')
24
                 ->description('The config code')
25
                  ->notNull()
26
                  ->index();
27
          $table->string('value')
28
                 ->description('The config value');
29
          $table->string('type')
30
                 ->description('The config data type');
31
          $table->text('comment')
32
                 ->description('The config description');
33
          $table->integer('status')
34
                 ->description('The config status')
35
                 ->defaultValue(0)
36
                 ->notNull();
37
          $table->datetime('created_at')
38
                  ->description('role created at')
39
                  ->notNull();
40
          $table->datetime('updated_at')
41
                  ->description('role updated at');
42
43
          $table->engine('INNODB');
44
      });
45
    }
46
47
    public function down(): void
48
    {
49
      //Action when migrate down
50
      $this->drop('config');
51
    }
52
}