<?php

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

class CreatePrintingProfileTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('printing_profile')) {
            Schema::create('printing_profile', function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->integer('product_sku_id')->nullable();
                $table->integer('blueprint_id')->nullable();
                $table->integer('variant_id')->nullable();
                $table->integer('print_provider_id')->nullable();
                $table->string('print_areas', 4096)->nullable();
                $table->string('options', 4096)->nullable();
                $table->string('position', 1024)->nullable();
                $table->string('type', 30)->default('printify');
                $table->dateTime('created_at')->nullable();
                $table->dateTime('updated_at')->nullable();
                $table->unique('product_sku_id');
                
                $table->charset = 'utf8mb4';
                $table->collation = 'utf8mb4_unicode_ci';
            });
        }
    }

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