CreateLogsTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 18
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 19
rs 9.6666
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class CreateLogsTable extends Migration {
7
    
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up() {
14
        Schema::create('database_logs', function (Blueprint $table) {
15
            $table->bigIncrements('id');
16
            $table->string('env');
17
            $table->string('message', 500);
18
            $table->enum('level', [
19
                'DEBUG',
20
                'INFO',
21
                'NOTICE',
22
                'WARNING',
23
                'ERROR',
24
                'CRITICAL',
25
                'ALERT',
26
                'EMERGENCY'
27
            ])->default('INFO');
28
            $table->text('context');
29
            $table->text('extra');
30
            $table->unsignedBigInteger('user_id')->nullable();
31
            $table->timestamps();
32
        });
33
    }
34
}