Passed
Branch master (182172)
by Matthew
04:03 queued 01:23
created

CreateDrafts::change()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.0856
c 0
b 0
f 0
cc 1
eloc 20
nc 1
nop 0
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class CreateDrafts extends AbstractMigration
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