Passed
Push — master ( 5d9325...8a350f )
by Curtis
11:22
created

AddColumnsForPeopleTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 15
nc 1
nop 0
dl 0
loc 21
rs 9.7666
c 3
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
return new class extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::table('people', function (Blueprint $table) {
12
            $table->string('gid')->nullable();
13
            $table->string('givn')->nullable();
14
            $table->string('surn', 191)->nullable();
15
            $table->string('name', 191)->nullable()->change();
16
17
            $table->string('type')->nullable();
18
            $table->string('npfx')->nullable();
19
            $table->string('nick')->nullable();
20
            $table->string('spfx')->nullable();
21
            $table->string('nsfx')->nullable();
22
23
            $table->char('sex', 1)->nullable();
24
            $table->text('description')->nullable();
25
            $table->integer('child_in_family_id')->references('id')->on('families')->nullable();
26
            $table->softDeletes();
27
            //    $table->dropColumn('bank');
28
            //    $table->dropColumn('bank_account');
29
            $table->dropUnique(['uid']);
30
        });
31
    }
32
33
    public function down()
34
    {
35
        Schema::table('people', function ($table) {
36
            //    $table->string('bank');
37
            //    $table->string('bank_account');
38
            $table->dropColumn('gid');
39
            $table->dropColumn('givn');
40
            $table->dropColumn('surn');
41
            $table->string('name')->nullable(false)->change();
42
            $table->dropColumn('sex');
43
            $table->dropColumn('description');
44
            $table->dropColumn('child_in_family_id');
45
            $table->dropColumn('deleted_at');
46
        });
47
    }
48
}
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected EOF, expecting ';' on line 48 at column 0
Loading history...
49