<?php

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

class CreateLaporanTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
      Schema::create('laporan', function (Blueprint $table) {
          $table->increments('id_laporan');
          $table->integer('id_perusahaan')->unsigned();
          $table->string('nama_file');
          $table->timestamps();
          $table->foreign('id_perusahaan')->references('id_perusahaan')->on('perusahaans')
            ->onUpdate('cascade')->onDelete('cascade');
      });
    }

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