CreateH5pContentsUserDataTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 12
dl 0
loc 31
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 13 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 CreateH5pContentsUserDataTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('h5p_contents_user_data', function (Blueprint $table) {
17
            $table->bigInteger('content_id')->unsigned();
18
            $table->bigInteger('user_id')->unsigned();
19
            $table->bigInteger('sub_content_id')->unsigned();
20
            $table->string('data_id', 127);
21
            $table->text('data');
22
            $table->boolean('preload')->default(0);
23
            $table->boolean('invalidate')->default(0);
24
            $table->dateTime('updated_at')->default(DB::raw('CURRENT_TIMESTAMP'));
25
            //			$table->dateTime('updated_at')->default('0000-00-00 00:00:00');
26
            $table->primary(['content_id', 'user_id', 'sub_content_id', 'data_id'], 'fk_primary');
27
        });
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     *
33
     * @return void
34
     */
35
    public function down()
36
    {
37
        Schema::drop('h5p_contents_user_data');
38
    }
39
}
40