Test Setup Failed
Pull Request — master (#42)
by Matthew
02:49
created

CreateTradeAssets   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A change() 0 12 1
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class CreateTradeAssets 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
        $trade_assets = $this->table('trade_assets', ['id' => 'tradeasset_id']);
10
        
11
        $trade_assets->addColumn('trade_id', 'integer', ['limit' => 11, 'signed' => false])
12
                ->addColumn('player_id', 'integer', ['limit' => 11, 'signed' => false])
13
                ->addColumn('oldmanager_id', 'integer', ['limit' => 11, 'signed' => false])
14
                ->addColumn('newmanager_id', 'integer', ['limit' => 11, 'signed' => false])
15
                ->addColumn('was_drafted', 'boolean', ['limit' => 1, 'default' => 0])
16
                ->addIndex(['trade_id', 'player_id', 'oldmanager_id', 'newmanager_id'])
17
                ->create();
18
    }
19
}
20