Test Failed
Push — master ( 741545...e25e21 )
by Julien
11:23
created

FlowActionMigration_100   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 148
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 83
c 0
b 0
f 0
dl 0
loc 148
ccs 0
cts 27
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 2 1
B morph() 0 119 1
A up() 0 2 1
1
<?php 
2
3
use Phalcon\Db\Column;
4
use Phalcon\Db\Index;
5
use Phalcon\Db\Reference;
6
use Phalcon\Migrations\Mvc\Model\Migration;
7
8
/**
9
 * Class FlowActionMigration_100
10
 */
11
class FlowActionMigration_100 extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
Coding Style introduced by
Class name "FlowActionMigration_100" is not in PascalCase format

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
12
{
13
    /**
14
     * Define the table structure
15
     *
16
     * @return void
17
     */
18
    public function morph()
19
    {
20
        $this->morphTable('flow_action', [
21
                'columns' => [
22
                    new Column(
23
                        'id',
24
                        [
25
                            'type' => Column::TYPE_INTEGER,
26
                            'unsigned' => true,
27
                            'notNull' => true,
28
                            'autoIncrement' => true,
29
                            'size' => 10,
30
                            'first' => true
31
                        ]
32
                    ),
33
                    new Column(
34
                        'flow_id',
35
                        [
36
                            'type' => Column::TYPE_INTEGER,
37
                            'unsigned' => true,
38
                            'notNull' => true,
39
                            'size' => 10,
40
                            'after' => 'id'
41
                        ]
42
                    ),
43
                    new Column(
44
                        'trigger_id',
45
                        [
46
                            'type' => Column::TYPE_INTEGER,
47
                            'notNull' => false,
48
                            'size' => 11,
49
                            'after' => 'flow_id'
50
                        ]
51
                    ),
52
                    new Column(
53
                        'transform_id',
54
                        [
55
                            'type' => Column::TYPE_INTEGER,
56
                            'unsigned' => true,
57
                            'notNull' => false,
58
                            'size' => 10,
59
                            'after' => 'trigger_id'
60
                        ]
61
                    ),
62
                    new Column(
63
                        'validation_id',
64
                        [
65
                            'type' => Column::TYPE_INTEGER,
66
                            'unsigned' => true,
67
                            'notNull' => false,
68
                            'size' => 10,
69
                            'after' => 'transform_id'
70
                        ]
71
                    ),
72
                    new Column(
73
                        'created_at',
74
                        [
75
                            'type' => Column::TYPE_DATETIME,
76
                            'default' => "current_timestamp()",
77
                            'notNull' => true,
78
                            'after' => 'validation_id'
79
                        ]
80
                    ),
81
                    new Column(
82
                        'updated_at',
83
                        [
84
                            'type' => Column::TYPE_DATETIME,
85
                            'notNull' => false,
86
                            'after' => 'created_at'
87
                        ]
88
                    ),
89
                    new Column(
90
                        'deleted_at',
91
                        [
92
                            'type' => Column::TYPE_DATETIME,
93
                            'notNull' => false,
94
                            'after' => 'updated_at'
95
                        ]
96
                    ),
97
                    new Column(
98
                        'deprecated_at',
99
                        [
100
                            'type' => Column::TYPE_DATETIME,
101
                            'notNull' => false,
102
                            'after' => 'deleted_at'
103
                        ]
104
                    ),
105
                    new Column(
106
                        'deleted',
107
                        [
108
                            'type' => Column::TYPE_TINYINTEGER,
109
                            'default' => "0",
110
                            'unsigned' => true,
111
                            'notNull' => true,
112
                            'size' => 1,
113
                            'after' => 'deprecated_at'
114
                        ]
115
                    ),
116
                    new Column(
117
                        'deprecated',
118
                        [
119
                            'type' => Column::TYPE_TINYINTEGER,
120
                            'default' => "0",
121
                            'unsigned' => true,
122
                            'notNull' => true,
123
                            'size' => 1,
124
                            'after' => 'deleted'
125
                        ]
126
                    )
127
                ],
128
                'indexes' => [
129
                    new Index('PRIMARY', ['id'], 'PRIMARY'),
130
                    new Index('id_UNIQUE', ['id'], 'UNIQUE')
131
                ],
132
                'options' => [
133
                    'table_type' => 'BASE TABLE',
134
                    'auto_increment' => '',
135
                    'engine' => 'InnoDB',
136
                    'table_collation' => 'utf8mb4_general_ci'
137
                ],
138
            ]
139
        );
140
    }
141
142
    /**
143
     * Run the migrations
144
     *
145
     * @return void
146
     */
147
    public function up()
148
    {
149
150
    }
0 ignored issues
show
Coding Style introduced by
Function closing brace must go on the next line following the body; found 1 blank lines before brace
Loading history...
151
152
    /**
153
     * Reverse the migrations
154
     *
155
     * @return void
156
     */
157
    public function down()
158
    {
159
160
    }
0 ignored issues
show
Coding Style introduced by
Function closing brace must go on the next line following the body; found 1 blank lines before brace
Loading history...
161
162
}
163