Completed
Branch master (4042af)
by Aleksandar
02:32
created

ArticlePosts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 8
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class ArticlePosts extends AbstractMigration
6
{
7
    public function up()
8
    {
9
        $this->table('article_posts', ['id' => false])
10
            ->addColumn('article_uuid', 'binary', ['limit' => 16])
11
            ->addColumn('title', 'text')
12
            ->addColumn('body', 'text')
13
            ->addColumn('lead', 'text')
14
            ->addColumn('featured_img', 'text', ['null' => true])
15
            ->addColumn('main_img', 'text', ['null' => true])
16
            ->addColumn('has_layout', 'boolean', ['default' => true])
17
            ->addForeignKey('article_uuid', 'articles', 'article_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION'])
18
            ->create();
19
    }
20
21
    public function down()
22
    {
23
        $this->dropTable('article_posts');
24
    }
25
}
26