| Current Path : /var/www/html/LLCF-APP/database/migrations/ |
| Current File : /var/www/html/LLCF-APP/database/migrations/2025_08_03_190822_create_health_table.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('health', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('student_id');
$table->unsignedInteger('family_id');
$table->timestamp('checkup_date');
$table->integer('pulse');
$table->float('body_temp');
$table->float('respiration');
$table->string('bp', 45);
$table->integer('height_cm');
$table->float('weight');
$table->float('bmi');
$table->string('bmi_percentile', 45);
$table->float('eye_left')->nullable();
$table->float('eye_right')->nullable();
$table->string('pallor', 45);
$table->string('lice', 45);
$table->string('consciousness', 45);
$table->string('diet', 45);
$table->string('teeth', 45);
$table->string('history', 100);
$table->string('diagnosis', 100);
$table->string('management', 100);
$table->string('advice', 100);
$table->string('refer', 100);
$table->string('followup', 100);
$table->string('session', 100);
$table->timestamp('created_on')->useCurrent();
$table->timestamp('updated_on')->nullable()->useCurrentOnUpdate();
$table->foreign('student_id')->references('id')->on('student')->onDelete('cascade');
$table->foreign('family_id')->references('id')->on('family')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('health');
}
};