<?php
// database/migrations/[timestamp]_create_recommendations_table.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('recommendations', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            $table->foreignId('activity_log_id')->constrained()->onDelete('cascade');
            $table->enum('category', ['Ringan', 'Sedang', 'Intensif']);
            $table->integer('recommended_minutes');
            $table->text('notes')->nullable();
            $table->json('model_input')->nullable();
            $table->date('recommendation_date');
            $table->timestamps();
        });
    }

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