|
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
|
|
|
} |
|
|
|
|
|
|
49
|
|
|
|