<?php

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

class CreateLogActionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('log_actions', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->nullable(); // người tác động
            $table->integer('hostel_id')->nullable();
            $table->integer('room_id')->nullable();
            $table->string('type')->nullable();
            $table->integer('object_id')->nullable(); // đối tượng bị tác động
            $table->text('desc')->nullable();
            $table->text('properties')->nullable();
            $table->timestamps();
        });
    }

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