<?php

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

class RekamMedis extends Migration
{
  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('rekam_medis', function (Blueprint $table) {
      $table->integerIncrements('rm_id');
      $table->integer('dp_id')->unsigned();
      $table->integer('p_id')->unsigned();

      $table->text('rm_diagnosa');
      $table->text('rm_terapi');

      $table->decimal('rm_pembayaran', 64);

      $table->timestamp('rm_created_at')->useCurrent();
      $table->timestamp('rm_updated_at')->nullable();
      $table->timestamp('rm_deleted_at')->nullable();

      $table->foreign('dp_id')->references('dp_id')->on('data_pasien');
      $table->foreign('p_id')->references('p_id')->on('pemeriksaan');
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    //
  }
}
