Users::change()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 17
c 2
b 0
f 0
dl 0
loc 24
rs 9.7
cc 1
nc 1
nop 0
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class Users extends AbstractMigration
6
{
7
    /**
8
     * @author Ronan Chilvers <[email protected]>
9
     */
10
    public function change()
11
    {
12
        $table = $this->table('users', [
13
            'id' => 'user_id',
14
        ]);
15
        $table
16
            ->addColumn('user_email', 'string', [
17
                'length' => 1024,
18
                'null'   => false,
19
            ])
20
            ->addColumn('user_password', 'string', [
21
                'length' => 128,
22
                'null'   => false,
23
            ])
24
            ->addColumn('user_status', 'string', [
25
                'length'  => 24,
26
                'null'    => false,
27
            ])
28
            ->addColumn('user_preferences', 'text', [
29
                'null'    => true,
30
            ])
31
            ->addTimestamps('user_created', 'user_updated')
32
            ->addIndex(['user_email'])
33
            ->create();
34
    }
35
}
36