<?php

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

class AlterMovimentosCaixaAddCaixaId extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('movimentos_caixa', function (Blueprint $table) {
            $table->bigInteger('caixa_id')->default(1);
            $table->foreign('caixa_id')
                ->references('id')
                ->on('caixas');
        });
    }

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