m171103_042857_queue   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 18 2
A down() 0 4 1
1
<?php
2
3
use yii\db\Migration;
4
5
class m171103_042857_queue extends Migration
6
{
7
    public function up()
8
    {
9
        $tableOptions = null;
10
        if ($this->db->driverName === 'mysql') {
11
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
12
        }
13
        $this->createTable('{{%queue}}', [
14
            'id' => $this->primaryKey(),
15
            'queue_id' => $this->integer()->notNull()->comment('队列id'),
16
            'catalog' => $this->string()->comment('类别'),
17
            'name' => $this->string()->notNull()->comment('任务名称'),
18
            'description' => $this->text()->comment('详请信息'),
19
            'log' => $this->text()->comment('错误日志'),
20
            'exec_time' => $this->integer()->comment('执行时间'),
21
            'created_at' => $this->integer()->comment('队列创建时间'),
22
            'updated_at' => $this->integer()->comment('队列执行时间'),
23
        ], $tableOptions);
24
    }
25
26
    public function down()
27
    {
28
        $this->dropTable('{{%queue}}');
29
    }
30
}
31