<?php

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

/**
 * Class CreateTransactionGroupsTable
 *
 */
class CreateTransactionGroupsTable extends Migration
{

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

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(
            'transaction_groups', function (Blueprint $table) {
                $table->increments('id');
                $table->timestamps();
                $table->softDeletes();
                $table->integer('user_id')->unsigned();
                $table->enum('relation', ['balance']);

                // connect reminders to users
                $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            }
        );


    }

}
