<?php

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

class CreatePlansTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('plans', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string("name");
            $table->longText("description");
            $table->string("stripe_id")->unique()->index();
            $table->unsignedInteger("n_athletes")->nullable();
            $table->unsignedInteger("n_coaches")->nullable();
            $table->unsignedInteger("n_admins")->nullable();
            $table->unsignedInteger("n_boxes")->nullable();
            $table->boolean("is_highlighted")->default(false);
            $table->boolean("active")->default(true)->index();
            $table->float("tax_prcnt")->default(21);
            $table->float("total")->nullable();
            $table->timestamps();
        });
    }

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