m160727_115711_addProgressColumns   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 18
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A initInverter() 0 21 1
1
<?php
2
namespace execut\import\migrations;
3
class m160727_115711_addProgressColumns extends \execut\yii\migration\Migration
4
{
5
    public function initInverter(\execut\yii\migration\Inverter $i)
6
    {
7
        $i->table('import_files')
8
            ->addColumn('rows_count', $this->integer())
9
            ->addColumn('rows_errors', $this->integer())
10
            ->addColumn('rows_success', $this->integer())
11
            ->addColumn('start_date', $this->dateTime())
12
            ->addColumn('end_date', $this->dateTime());
13
        $i->createTable('import_logs', array_merge($this->defaultColumns(), [
14
            'level' => $this->integer()->notNull(),
15
            'category' => $this->string()->notNull(),
16
            'prefix' => $this->string(),
17
            'message' => $this->text(),
18
            'row_nbr' => $this->integer(),
19
            'column_nbr' => $this->integer(),
20
            'value' => $this->string(),
21
        ]));
22
23
        $i->table('import_logs')
24
            ->addForeignColumn('import_files', true)
25
            ->addForeignColumn('import_settings_values');
26
    }
27
}
28