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

ProjectKeepDeployments::change()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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