<?php

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

class CreateMedicalReportTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('medical_report', function (Blueprint $table) {
            $table->string('id')->primary();
            $table->string('patients_id');
            $table->unsignedBigInteger('users_id');
            $table->text('description');
            $table->timestamp('created_at')->useCurrent();
            $table->timestamp('updated_at')->nullable();
            
            $table->foreign('users_id', 'FK_04f48899cf6d2a50670697ef118')->references('id')->on('users');
            $table->foreign('patients_id', 'FK_398889999bf22c82adf7209c267')->references('id')->on('patients');
        });
    }

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