Completed
Push — master ( bfdf74...8a4d0b )
by Stéphane
13:35
created

AddMissingFields   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 19 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 63
    public function up()
14
    {
15 63
        Schema::table(
16 63
            'contents',
17
            function (Blueprint $table) {
18 63
                $table->string('type')->nullable();
19 63
                $table->boolean('published')->default(true);
20 63
            }
21 63
        );
22
23 63
        Schema::table(
24 63
            'revisions',
25
            function (Blueprint $table) {
26 63
                $table->boolean('published')->default(true);
27 63
            }
28 63
        );
29
30
31 63
    }
32
33
    /**
34
     * Reverse the migrations.
35
     *
36
     * @return void
37
     */
38 63
    public function down()
39
    {
40 63
        Schema::table(
41 63
            'contents',
42
            function (Blueprint $table) {
43 63
                $table->removeColumn('type');
44 63
                $table->removeColumn('published');
45 63
            }
46 63
        );
47
48 63
        Schema::table(
49 63
            'revisions',
50 63
            function (Blueprint $table) {
51 63
                $table->removeColumn('published');
52 63
            }
53 63
        );
54 63
    }
55
}
56