<?php

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

class UpdateConversationPermission extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::table('conversations', function(Blueprint $table) {
           $table->boolean('is_visible')->default(true);
           $table->integer('allow_chat')->default(1);
        });

        Schema::table('users', function(Blueprint $table) {
           $table->integer('day_remind_empty_room')->default(10);
           $table->boolean('allow_renter_make_group')->default(true);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::table('conversations', function(Blueprint $table) {
            $table->dropColumn('is_visible');
            $table->dropColumn('allow_chat');
        });

        Schema::table('users', function(Blueprint $table) {
            $table->dropColumn('day_remind_empty_room');
            $table->dropColumn('allow_renter_make_group');
        });
    }
}
