DatabaseTruncater::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Seeder;
4
use Illuminate\Support\Facades\DB;
5
6
class DatabaseTruncater extends Seeder
7
{
8
    public function run()
9
    {
10
        DB::statement('BEGIN;');
11
        DB::statement('ALTER TABLE tokens DISABLE TRIGGER ALL;');
12
        DB::statement('TRUNCATE searches CASCADE');
13
        DB::statement('TRUNCATE tokens CASCADE');
14
        DB::statement('TRUNCATE notifications CASCADE');
15
        DB::statement('TRUNCATE users CASCADE');
16
        DB::statement('TRUNCATE recruiters CASCADE');
17
        DB::statement('ALTER TABLE tokens ENABLE TRIGGER ALL;');
18
        DB::statement('COMMIT;');
19
    }
20
}
21