Users_21012021130204_migration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 18 1
1
<?php
2
3
namespace App\Ship\Migration;
4
5
use Rudra\Model\QBFacade;
6
use Rudra\Container\Facades\Rudra;
7
8
class Users_21012021130204_migration
9
{
10
    public function up(): void
11
    {
12
        $table = "users";
13
14
        $qString = QBFacade::create($table)
15
            ->integer('id', '', true)
16
            ->string('name')
17
            ->string('email', 'NOT NULL UNIQUE')
18
            ->string('password')
19
            ->string('role')
20
            ->integer('status', 'DEFAULT 1')
21
            ->created_at()
22
            ->updated_at()
23
            ->pk('id')
24
            ->close()
25
            ->get();
26
27
        Rudra::get("DSN")->prepare("$qString")->execute();
28
    }
29
}
30