<?php

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

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

            $table->string('name');
            $table->string('component')->nullable();
            $table->text('html')->nullable();
            $table->text('show_at')->nullable();

            $table->tinyInteger('pos')->unsigned()->nullable();
            $table->boolean('active')->default(true);

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

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connection('mysql_stern')->dropIfExists('sidebar_widgets');
    }
}