<?php

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

class CreateClipartTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(!Schema::hasTable('clipart')) {
            Schema::create('clipart', function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->bigInteger('owner_id');
                $table->string('name');
                $table->text('description')->nullable();
                $table->text('citations')->nullable();
                $table->string('paid')->nullable();
                $table->string('type');
                $table->text('path')->nullable();
                $table->text('filename')->nullable();
                $table->timestamps();
                $table->softDeletes();
                $table->bigInteger('created_by')->nullable();
                $table->binary('thumb')->nullable();
            });
        }
    }

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