DatabaseTruncater   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 1
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