<?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('exercises', function (Blueprint $table) {
            $table->id();
            $table->string('external_id')->unique();      // "0001" du dataset
            $table->string('name');
            $table->string('slug')->index();
            $table->string('category')->nullable()->index();     // waist, chest...
            $table->string('body_part')->nullable()->index();    // upper arms, back...
            $table->string('equipment')->nullable()->index();    // dumbbell, body weight...
            $table->string('target')->nullable()->index();       // muscle cible principal
            $table->string('muscle_group')->nullable();          // synergistes primaires
            $table->json('secondary_muscles')->nullable();       // ["deltoid", ...]
            $table->json('instructions')->nullable();            // { en:[...], fr:[...] }
            $table->string('image_path')->nullable();            // clé S3 / chemin média
            $table->string('gif_path')->nullable();
            $table->string('attribution')->nullable();
            $table->timestamps();
        });
    }

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