Completed
Pull Request — master (#84)
by Renato
03:16 queued 45s
created

GithubIdToProviderId   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 66
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B up() 0 26 1
B down() 0 26 1
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class GithubIdToProviderId extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::table('users', function (Blueprint $table) {
17
            $table->renameColumn('github_id', 'provider_id');
18
        });
19
20
        Schema::table('pull_requests', function (Blueprint $table) {
21
            $table->renameColumn('github_id', 'provider_id');
22
        });
23
24
        Schema::table('product_backlogs', function (Blueprint $table) {
25
            $table->renameColumn('github_id', 'provider_id');
26
        });
27
28
        Schema::table('organizations', function (Blueprint $table) {
29
            $table->renameColumn('github_id', 'provider_id');
30
        });
31
32
        Schema::table('issues', function (Blueprint $table) {
33
            $table->renameColumn('github_id', 'provider_id');
34
        });
35
36
        Schema::table('comments', function (Blueprint $table) {
37
            $table->renameColumn('github_id', 'provider_id');
38
        });
39
    }
40
41
    /**
42
     * Reverse the migrations.
43
     *
44
     * @return void
45
     */
46
    public function down()
47
    {
48
        Schema::table('users', function (Blueprint $table) {
49
            $table->renameColumn('provider_id', 'github_id');
50
        });
51
52
        Schema::table('pull_requests', function (Blueprint $table) {
53
            $table->renameColumn('provider_id', 'github_id');
54
        });
55
56
        Schema::table('product_backlogs', function (Blueprint $table) {
57
            $table->renameColumn('provider_id', 'github_id');
58
        });
59
60
        Schema::table('organizations', function (Blueprint $table) {
61
            $table->renameColumn('provider_id', 'github_id');
62
        });
63
64
        Schema::table('issues', function (Blueprint $table) {
65
            $table->renameColumn('provider_id', 'github_id');
66
        });
67
68
        Schema::table('comments', function (Blueprint $table) {
69
            $table->renameColumn('provider_id', 'github_id');
70
        });
71
    }
72
}
73