38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('patients', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name')->comment('姓名');
|
|
$table->string('gender')->comment('性别');
|
|
$table->integer('age')->comment('年龄');
|
|
$table->string('diagnosis')->comment('出院诊断');
|
|
$table->date('discharge_date')->comment('转诊时间');
|
|
$table->string('address')->nullable()->comment('户籍地址');
|
|
$table->string('phone')->nullable()->comment('联系方式');
|
|
$table->string('remark')->nullable()->comment('备注');
|
|
$table->integer('follow_up_count')->default(0)->comment('已随访次数');
|
|
$table->date('last_follow_up_date')->nullable()->comment('上次随访日期');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('patients');
|
|
}
|
|
};
|