Users_21012021130204_migration::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 18
rs 9.7998
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