Passed
Branch master (44bfae)
by giu
03:41
created

CreateOperations   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A change() 0 25 1
1
<?php
2
use Migrations\AbstractMigration;
3
4
class CreateOperations extends AbstractMigration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

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('operations');
16
        $table->addColumn('ticket_id', 'integer', [
17
            'default' => null,
18
            'limit' => 11,
19
            'null' => false,
20
        ]);
21
        $table->addColumn('start', 'datetime', [
22
            'default' => null,
23
            'null' => false,
24
        ]);
25
        $table->addColumn('end', 'datetime', [
26
            'default' => null,
27
            'null' => false,
28
        ]);
29
        $table->addColumn('created', 'datetime', [
30
            'default' => null,
31
            'null' => true,
32
        ]);
33
        $table->addColumn('modified', 'datetime', [
34
            'default' => null,
35
            'null' => true,
36
        ]);
37
        $table->create();
38
    }
39
}
40