Passed
Push — master ( ddb2ad...499e20 )
by Бабичев
09:06
created

UpdateTransfersTable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
dl 0
loc 28
rs 10
c 1
b 0
f 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A table() 0 3 1
A up() 0 4 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
use Bavix\Wallet\Models\Transfer;
7
8
class UpdateTransfersTable extends Migration
9
{
10
11
    /**
12
     * @return string
13
     */
14
    protected function table(): string
15
    {
16
        return (new Transfer())->getTable();
17
    }
18
19
    /**
20
     * @return void
21
     */
22
    public function up(): void
23
    {
24
        Schema::table($this->table(), function(Blueprint $table) {
25
            $table->boolean('refund')->default(0);
26
        });
27
    }
28
29
    /**
30
     * @return void
31
     */
32
    public function down(): void
33
    {
34
        Schema::table($this->table(), function (Blueprint $table) {
35
            $table->dropColumn('refund');
36
        });
37
    }
38
39
}
40