<?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('reports', function (Blueprint $table) {
            $table->id();
            $table->timestamp('request_time')->nullable();;
            $table->string('device_xid');
            $table->timestamp('start_date')->nullable();;
            $table->timestamp('end_date')->nullable();;
            $table->boolean('report_type')->default(false)->comment('Report status: 0 = pdf, 1 = spreadsheet');
            $table->boolean('download_status')->default(false)->comment('Download status: 0 = failed, 1 = completed');
            $table->softDeletes();
            $table->timestamps();
        });
    }

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