Completed
Pull Request — master (#39)
by
unknown
02:27
created

UpdateArticleTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 10 1
A down() 0 9 1
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class UpdateArticleTable extends AbstractMigration
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...
6
{
7
    public function up()
8
    {
9
        $this->table('articles')
10
            ->addColumn('body', 'text')
11
            ->addColumn('lead', 'text')
12
            ->addColumn('status', 'integer')
13
            ->addColumn('user_uuid', 'binary', ['limit' => 16])
14
            ->addColumn('created_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP'])
15
            ->update();
16
    }
17
18
    public function down()
19
    {
20
        $this->table('articles')
21
            ->removeColumn('body')
22
            ->removeColumn('lead')
23
            ->removeColumn('status')
24
            ->removeColumn('user_uuid')
25
            ->removeColumn('created_at');
26
    }
27
}
28