CreateWarehouses::change()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 9.8666
1
<?php
2
use Migrations\AbstractMigration;
3
4
class CreateWarehouses extends AbstractMigration
0 ignored issues
show
Deprecated Code introduced by
The class Migrations\AbstractMigration has been deprecated: 4.5.0 You should use Migrations\BaseMigration for new migrations. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

4
class CreateWarehouses extends /** @scrutinizer ignore-deprecated */ AbstractMigration
Loading history...
5
{
6
    /**
7
     * Change Method.
8
     *
9
     * More information on this method is available here:
10
     * http://docs.phinx.org/en/latest/migrations.html#the-change-method
11
     * @return void
12
     */
13
    public function change()
14
    {
15
        $table = $this->table('warehouses');
16
        $table->addColumn('name', 'string', [
17
            'default' => null,
18
            'limit' => 255,
19
            'null' => false,
20
        ]);
21
        $table->addColumn('created', 'datetime', [
22
            'default' => null,
23
            'null' => false,
24
        ]);
25
        $table->addColumn('modified', 'datetime', [
26
            'default' => null,
27
            'null' => false,
28
        ]);
29
        $table->create();
30
    }
31
}
32