Passed
Push — master ( 9cd84f...e0eacc )
by Ronan
04:52
created

ProjectKeepDeployments   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A change() 0 9 1
1
<?php
2
declare(strict_types=1);
3
4
use App\Model\Project;
5
use Phinx\Migration\AbstractMigration;
6
7
final class ProjectKeepDeployments extends AbstractMigration
8
{
9
    /**
10
     * Change Method.
11
     *
12
     * Write your reversible migrations using this method.
13
     *
14
     * More information on writing migrations is available here:
15
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
16
     *
17
     * Remember to call "create()" or "update()" and NOT "save()" when working
18
     * with the Table class.
19
     */
20
    public function change(): void
21
    {
22
        $project = $this->table(Project::table());
23
        $project
24
            ->addColumn('project_keep_deployments', 'integer', [
25
                'null'   => false,
26
                'after'  => 'project_branch',
27
            ])
28
            ->update();
29
    }
30
}
31