TruncateTables::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Console\Commands;
9
10
use Illuminate\Console\Command;
11
12
class TruncateTables extends Command
13
{
14
    /**
15
     * The name and signature of the console command.
16
     *
17
     * @var string
18
     */
19
    protected $signature = 'debug:truncate';
20
21
    /**
22
     * The console command description.
23
     *
24
     * @var string
25
     */
26
    protected $description = 'Leere Tabellen, die zu Debug Zwecken gefüllt wurden.';
27
28
    /**
29
     * Create a new command instance.
30
     */
31
    public function __construct()
32
    {
33
        parent::__construct();
34
    }
35
36
    /**
37
     * Execute the console command.
38
     *
39
     * @return mixed
40
     */
41
    public function handle()
42
    {
43
        $this->info('Leere Games Tabelle');
44
        \DB::table('games')->truncate();
45
46
        $this->info('Leere comments Tabelle');
47
        \DB::table('comments')->truncate();
48
49
        $this->info('Leere games_files Tabelle');
50
        \DB::table('games_files')->truncate();
51
52
        $this->info('Leere games_developers Tabelle');
53
        \DB::table('games_developers')->truncate();
54
55
        $this->info('Leere developer Tabelle');
56
        \DB::table('developer')->truncate();
57
58
        $this->info('Tabellen wurden geleert.');
59
    }
60
}
61