<?php

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

class AlterUserAttemptsTableAddPhaseColumns extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('user_attempts', function (Blueprint $table) {
            $table->dateTime('memory_matrix_start_time')->after('end_time')->nullable();
            $table->dateTime('memory_matrix_end_time')->after('memory_matrix_start_time')->nullable();
            $table->integer('memory_matrix_result')->after('memory_matrix_start_time')->nullable();

            $table->dateTime('speed_arithmetic_start_time')->after('memory_matrix_result')->nullable();
            $table->dateTime('speed_arithmetic_end_time')->after('speed_arithmetic_start_time')->nullable();
            $table->integer('speed_arithmetic_result')->after('speed_arithmetic_end_time')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('user_attempts', function (Blueprint $table) {
            //
        });
    }
}
