<?php

use App\Database\Blueprint;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        DB::statement('CREATE TABLE order_archives_items LIKE products; ');
        Schema::table('order_archives_items', function (Blueprint $table) {
            $table->unsignedBigInteger('order_archive_id');
            $table->string('supplier_name')->nullable();
            $table->string('producer_name')->nullable();
            $table->string('product_group_name')->nullable();
            $table->string('product_group_path')->nullable();
            $table->float('quantity')->nullable();
            $table->float('price')->nullable();
            $table->float('amount')->nullable();
        });
    }

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