<?php

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

class CreateRandDVotingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('randd_votings', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->Integer('project_id')->unsigned();
            $table->foreign('project_id')->references('id')->on('new_randd');
            $table->text('description')->nullable();
            $table->tinyInteger('status');
            $table->Integer('user_id')->unsigned();
            $table->foreign('user_id')->references('id')->on('users');
            $table->timestamps();
        });
    }

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