<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        // Add server_start_time setting with default value (current time)
        DB::table('settings')->insert([
            'key' => 'server_start_time',
            'value' => now()->toIso8601String(),
            'created_at' => now(),
            'updated_at' => now(),
        ]);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        // Remove server_start_time setting
        DB::table('settings')->where('key', 'server_start_time')->delete();
    }
};
