CreateMigrationsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 39
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 21 1
A down() 0 4 1
1
<?php
2
3
namespace Yarak\Migrations;
4
5
use Phalcon\Db\Column;
6
use Phalcon\Db\Adapter\Pdo;
7
8
class CreateMigrationsTable implements Migration
9
{
10
    /**
11
     * Run the migration.
12
     *
13
     * @param Pdo $connection
14
     */
15
    public function up(Pdo $connection)
16
    {
17
        $connection->createTable(
18
            'migrations',
19
            null,
20
            [
21
                'columns' => [
22
                    new Column('migration', [
23
                        'type'    => Column::TYPE_VARCHAR,
24
                        'size'    => 250,
25
                        'notNull' => true,
26
                    ]),
27
                    new Column('batch', [
28
                        'type'    => Column::TYPE_INTEGER,
29
                        'size'    => 10,
30
                        'notNull' => true,
31
                    ]),
32
                ],
33
            ]
34
        );
35
    }
36
37
    /**
38
     * Reverse the migration.
39
     *
40
     * @param Pdo $connection
41
     */
42
    public function down(Pdo $connection)
43
    {
44
        $connection->dropTable('migrations');
45
    }
46
}
47