AddMonzoColumns::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
c 1
b 0
f 0
rs 9.6666
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 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