CreateSirgrimorumCmsArticles   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 15 1
A down() 0 3 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateSirgrimorumCmsArticles extends Migration {
7
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('articles', function($table)
16
        {
17
            $table->engine = 'InnoDB';
18
            $table->bigIncrements('id');
19
            $table->string('nickname',50);
20
            $table->string('scope',50);
21
            $table->string('lang',10);
22
            $table->longtext('content');
23
            $table->boolean('activated')->default(0);
24
            $table->bigInteger('user_id')->unsigned()->nullable();
25
            $table->timestamps();
26
            $table->unique(array('nickname','lang','scope'));
27
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
28
        });
29
    }
30
31
    /**
32
     * Reverse the migrations.
33
     *
34
     * @return void
35
     */
36
    public function down()
37
    {
38
        Schema::drop('articles');
39
    }
40
41
}
42