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

UpdateTransfersTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 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