<?php

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

class CreateVdbInventoryLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tbl_vdb_inventory_log', function (Blueprint $table) {
            $table->id();
            $table->integer('total_record');
            $table->integer('total_update');
            $table->integer('total_insert');
            $table->integer('total_delete');
            $table->string('file')->nullable(); // Assuming file is optional
            $table->timestamp('log_time')->useCurrent();
            $table->enum('type', ['diamond_import', 'other_type'])->default('diamond_import');
            $table->unsignedBigInteger('vendor_id')->nullable(); // Assuming vendor_id is nullable
            $table->timestamp('start_time');
            $table->timestamp('end_time');
            $table->timestamps();
        });
    }

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