<?php

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

class CreatePromotionAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('promotion_admins', function (Blueprint $table) {
            $table->increments('id');

            $table->unsignedTinyInteger('type')->default(1);

            $table->string('name', 255);
            $table->text('description')->nullable();
            $table->text('user_description')->nullable();
            $table->text('user_about')->nullable();

            $table->date('from')->nullable();
            $table->date('to')->nullable();

            $table->decimal('max_bugdet', 13, 2)->nullable();
            $table->unsignedSmallInteger('max_items')->nullable();

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

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

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

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