<?php

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

class UpdateHostelRoomImage extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('hostel_images', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('hostel_id')->nullable();
            $table->string('image')->nullable();
            $table->integer('type')->nullable();
            $table->timestamps();
        });

        Schema::create('room_images', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('room_id')->nullable();
            $table->string('image')->nullable();
            $table->integer('type')->nullable();
            $table->timestamps();
        });

        Schema::table('hostels', function(Blueprint $table) {
            $table->integer('type_rent')->default(0);
        });
    }

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