1 | <?php |
||
5 | class CreatePlayers extends AbstractMigration |
||
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 |