CreateH5pContentsUserDataTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 1
nc 1
nop 0
dl 0
loc 3
c 1
b 1
f 0
cc 1
rs 10
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