<?php

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

class CreateGroupStepsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('group_steps', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('modular_id')->unsigned()->index();
            $table->string('previous');
            $table->string('next');
            $table->timestamps();

            $table->foreign('modular_id')->references('id')->on('modular_steps');
        });
    }

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