<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('home_carousel_slides', function (Blueprint $table) {
            $table->string('image_path_desktop', 255)->nullable()->comment('電腦圖');
            $table->string('image_path_mobile', 255)->nullable()->comment('手機圖');

            $table->index(['image_path_desktop', 'image_path_mobile']);
        });
    }

    public function down(): void
    {
        Schema::table('home_carousel_slides', function (Blueprint $table) {
            $table->dropIndex(['image_path_desktop', 'image_path_mobile']);
            $table->dropColumn(['image_path_desktop', 'image_path_mobile']);
        });
    }
};
