Completed
Push — master ( fb8886...624979 )
by Matthew
9s
created

CreatePlayers   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A change() 0 23 1
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class CreatePlayers 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...
6
{
7
    public function change()
8
    {
9
        $players = $this->table('players', ['id' => 'player_id']);
10
        
11
        $players->addColumn('manager_id', 'integer', ['limit' => 11, 'default' => 0])
12
                ->addColumn('draft_id', 'integer', ['limit' => 11, 'signed' => false, 'default' => 0])
13
                ->addColumn('first_name', 'text', ['null' => true])
14
                ->addColumn('last_name', 'text', ['null' => true])
15
                ->addColumn('team', 'char', ['limit' => 3, 'null' => true])
16
                ->addColumn('position', 'string', ['limit' => 4, 'null' => true])
17
                ->addColumn('pick_time', 'datetime', ['null' => true])
18
                ->addColumn('pick_duration', 'integer', ['limit' => 10, 'null' => true])
19
                ->addColumn('player_counter', 'integer', ['limit' => 11, 'null' => true])
20
                ->addColumn('player_round', 'integer', ['limit' => 11, 'default' => 0])
21
                ->addColumn('player_pick', 'integer', ['limit' => 11, 'default' => 0])
22
                ->addColumn('depth_chart_position_id', 'integer', ['limit' => 11, 'null' => true])
23
                ->addColumn('position_eligibility', 'string', ['limit' => 24, 'null' => true])
24
                ->addIndex('manager_id', ['name' => 'manager_idx'])
25
                ->addIndex('draft_id', ['name' => 'draft_idx'])
26
                ->addIndex('player_counter', ['name' => 'counter_idx'])
27
                ->addIndex('depth_chart_position_id', ['name' => 'depth_chart_idx'])
28
                ->create();
29
    }
30
}
31