<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('items_history', function (Blueprint $table) {
            $table->string('short_description')->nullable();
            $table->string('note')->nullable();
            $table->foreignId('cart_id')->constrained('carts')->nullable();
            $table->foreignId('item_id')->constrained('items')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists("items_history");
    }
};
