<?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::table('users', function (Blueprint $table): void {
            $table->unsignedInteger('daily_calorie_goal')->default(2000)->after('avatar_url');
            $table->decimal('daily_protein_goal', 8, 2)->default(120)->after('daily_calorie_goal');
            $table->decimal('daily_carbs_goal', 8, 2)->default(250)->after('daily_protein_goal');
            $table->decimal('daily_fats_goal', 8, 2)->default(70)->after('daily_carbs_goal');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table): void {
            $table->dropColumn([
                'daily_calorie_goal',
                'daily_protein_goal',
                'daily_carbs_goal',
                'daily_fats_goal',
            ]);
        });
    }
};
