<?php

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

class CreatePengumumanTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_pengumuman', function (Blueprint $table) {
            $table->increments('id');
            $table->string('jenis');
            $table->string('judul');
            $table->string('keterangan');
            $table->string('file')->nullable();
            $table->integer('id_users')->unsigned();
            $table->foreign('id_users')
                  ->references('id')->on('users')
                  ->onDelete('cascade');
            $table->softDeletes();
            $table->timestamps();
        });
    }

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