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

CreateDrafts   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 CreateDrafts 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
        $draft = $this->table('draft', ['id' => 'draft_id']);
10
        
11
        $draft->addColumn('commish_id', 'integer', ['limit' => 11])
12
                ->addColumn('draft_create_time', 'datetime')
13
                ->addColumn('draft_name', 'text')
14
                ->addColumn('draft_sport', 'text')
15
                ->addColumn('draft_status', 'text')
16
                ->addColumn('draft_counter', 'integer', ['limit' => 11, 'default' => 0])
17
                ->addColumn('draft_style', 'text')
18
                ->addColumn('draft_rounds', 'integer', ['limit' => 2, 'signed' => false, 'default' => 0])
19
                ->addColumn('draft_password', 'text', ['null' => true, 'default' => null])
20
                ->addColumn('draft_start_time', 'datetime', ['null' => true, 'default' => null])
21
                ->addColumn('draft_end_time', 'datetime', ['null' => true, 'default' => null])
22
                ->addColumn('draft_stats_generated', 'datetime', ['null' => true, 'default' => null])
23
                ->addColumn('draft_current_round', 'integer', ['limit' => 5, 'default' => 1, 'signed' => false])
24
                ->addColumn('draft_current_pick', 'integer', ['limit' => 5, 'default' => 1, 'signed' => false])
25
                ->addColumn('nfl_extended', 'boolean', ['limit' => 1, 'default' => 0])
26
                ->addColumn('using_depth_charts', 'boolean', ['default' => 0])
27
                ->addIndex(['commish_id'])
28
                ->create();
29
    }
30
}
31