<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('info_items', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('item')->nullable()->index('item');
            $table->string('item_id')->nullable();
            $table->string('item_str')->nullable();
            $table->integer('sub_item')->nullable();
            $table->string('sub_item_id')->nullable();
            $table->string('sub_item_str')->nullable();
            $table->string('sub_item_unit')->nullable();
            $table->unsignedSmallInteger('needs_image')->nullable()->default(0);
            $table->unsignedSmallInteger('needs_end_point')->nullable()->default(0);
            $table->string('icon')->nullable();
            $table->string('type')->nullable()->default('item');
        });
    }

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