Passed
Push — master ( 67dba0...1fee4a )
by Ronan
07:47 queued 04:25
created

DeploymentBranch   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

1 Method

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