AddMonzoColumns   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
dl 0
loc 33
c 1
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 9 1
A down() 0 9 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 AddMonzoColumns extends Migration
8
{
9
    /**
10
     * Run migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::table('users', function (Blueprint $table) {
17
            $table->string('monzo_user_id')->index()->nullable();
18
            $table->text('monzo_access_token')->nullable();
19
            $table->text('monzo_refresh_token')->nullable();
20
21
            $table->string(config('monzo.webhooks.user_token'))->nullable();
22
            $table->string(config('monzo.webhooks.token'))->nullable();
23
        });
24
    }
25
26
    /**
27
     * Reverse migrations.
28
     *
29
     * @return void
30
     */
31
    public function down()
32
    {
33
        Schema::table('users', function (Blueprint $table) {
34
            $table->dropColumn([
35
                'monzo_user_id',
36
                'monzo_access_token',
37
                'monzo_refresh_token',
38
                config('monzo.webhooks.token'),
39
                config('monzo.webhooks.user_token'),
40
            ]);
41
        });
42
    }
43
}
44