CreateProviderTypeEnum::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateProviderTypeEnum extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     */
12
    public function up()
13
    {
14
        Schema::table('users', function (Blueprint $table) {
15
            $table->enum('provider', ['gitlab', 'github'])->default('github')->after('provider_id');
16
        });
17
18
        Schema::table('organizations', function (Blueprint $table) {
19
            $table->enum('provider', ['gitlab', 'github'])->default('github')->after('provider_id');
20
        });
21
22
        Schema::table('issues', function (Blueprint $table) {
23
            $table->enum('provider', ['gitlab', 'github'])->default('github')->after('provider_id');
24
        });
25
    }
26
27
    /**
28
     * Reverse the migrations.
29
     */
30
    public function down()
31
    {
32
        Schema::table('users', function (Blueprint $table) {
33
            $table->dropColumn('provider');
34
        });
35
36
        Schema::table('organizations', function (Blueprint $table) {
37
            $table->dropColumn('provider');
38
        });
39
40
        Schema::table('issues', function (Blueprint $table) {
41
            $table->dropColumn('provider');
42
        });
43
    }
44
}
45