<?php

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

class CreateTemplatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('templates', function (Blueprint $table) {
			$table->id();
			$table->string('name');
			$table->smallInteger('type')->default(0);
			$table->tinyText('description')->nullable();
			$table->string('title')->nullable();
			$table->longText('content')->nullable();
			$table->foreignId('user_id')->constrained();
			$table->smallInteger('group')->default(0);
			$table->smallInteger('is_activated')->default(1);
			$table->smallInteger('is_deleted')->default(0);
			$table->timestamps();
        });
    }

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