CreateH5pResultsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 12
dl 0
loc 30
c 1
b 1
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 12 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateH5pResultsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('h5p_results', function (Blueprint $table) {
17
            $table->bigIncrements('id');
18
            $table->bigInteger('content_id')->unsigned();
19
            $table->bigInteger('user_id')->unsigned();
20
            $table->bigInteger('score')->unsigned();
21
            $table->bigInteger('max_score')->unsigned();
22
            $table->bigInteger('opened')->unsigned();
23
            $table->bigInteger('finished')->unsigned();
24
            $table->bigInteger('time')->unsigned();
25
            $table->index(['content_id', 'user_id'], 'content_user');
26
        });
27
    }
28
29
    /**
30
     * Reverse the migrations.
31
     *
32
     * @return void
33
     */
34
    public function down()
35
    {
36
        Schema::drop('h5p_results');
37
    }
38
}
39