AddMissingFields   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 48
ccs 27
cts 27
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 17 1
A down() 0 17 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class AddMissingFields extends Migration
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13 117
    public function up()
14
    {
15 117
        Schema::table(
16 117
            'contents',
17
            function (Blueprint $table) {
18 117
                $table->string('type')->nullable();
19 117
                $table->boolean('published')->default(true);
20 117
            }
21 117
        );
22
23 117
        Schema::table(
24 117
            'revisions',
25
            function (Blueprint $table) {
26 117
                $table->boolean('published')->default(true);
27 117
            }
28 117
        );
29 117
    }
30
31
    /**
32
     * Reverse the migrations.
33
     *
34
     * @return void
35
     */
36 117
    public function down()
37
    {
38 117
        Schema::table(
39 117
            'contents',
40
            function (Blueprint $table) {
41 117
                $table->removeColumn('type');
42 117
                $table->removeColumn('published');
43 117
            }
44 117
        );
45
46 117
        Schema::table(
47 117
            'revisions',
48 117
            function (Blueprint $table) {
49 117
                $table->removeColumn('published');
50 117
            }
51 117
        );
52 117
    }
53
}
54