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

UpdateArticleTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
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