<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
       Schema::create('progresses', function (Blueprint $table) {
    $table->id();
    $table->foreignId('member_id')->constrained('members')->onDelete('cascade');
    $table->date('date');
    $table->string('trainer_name')->nullable();

    // Measurements
    $table->float('weight')->nullable();
    $table->float('height')->nullable();
    $table->float('waist')->nullable();
    $table->float('hip')->nullable();
    $table->float('bmi')->nullable();

    // Other daily details
    $table->float('sleep')->nullable();
    $table->string('nutrition')->nullable();
    $table->integer('stress')->nullable();
    $table->boolean('workout_completed')->default(false);
    $table->text('notes')->nullable();

    $table->boolean('diet_followed')->default(false);
    $table->boolean('hydration_ok')->default(false);
    $table->boolean('sleep_goal_met')->default(false);

    $table->timestamps();
});
    }

    public function down(): void
    {
        Schema::dropIfExists('progresses');
    }
};
