<?php

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

class CreatePaymentMethodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('payment_methods', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->index();
            $table->string('short', 10);
            $table->unsignedTinyInteger('show_at')->nullable()->default(0);
            $table->unsignedTinyInteger('pos')->nullable()->default(0);
            $table->decimal('max_price', 8, 2)->nullable();

            $table->boolean('active')->default(false);
            $table->boolean('default')->default(false);

            $table->timestamps();
        });
    }

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