<?php

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

class CreateTrainingWorkoutLinesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('training_workout_lines', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('training_workout_section_id');
            $table->longText("description")->nullable();

            // RX
            $table->unsignedBigInteger("exercise_id")->index();
            $table->integer("seconds")->nullable();
            $table->string("reps")->nullable();
            $table->string("maleVal")->nullable();
            $table->string("femaleVal")->nullable();
            $table->string("units", 10)->nullable();

            // SCALED
            $table->unsignedBigInteger("exercise_scaled_id")->nullable()->index();
            $table->integer("seconds_scaled")->nullable();
            $table->string("reps_scaled")->nullable();
            $table->string("maleVal_scaled")->nullable();
            $table->string("femaleVal_scaled")->nullable();
            $table->string("units_scaled", 10)->nullable();

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

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('training_section_lines');
    }
}
