<?php

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

class UpdateMoneySpendReceiver extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
	    Schema::table('collect_spends', function(Blueprint $table) {
	    	$table->string('receiver')->nullable();
	    });

	    Schema::create('receivers', function (Blueprint $table) {
	    	$table->increments('id');
	    	$table->string('name')->nullable();
	    	$table->integer('user_id')->nullable();
	    	$table->timestamps();
	    });
    }

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

	    Schema::drop('receivers');
    }
}
