<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     * GCS(Google Cloud Storage) URI 저장 컬럼 추가
     */
    public function up(): void
    {
        if (!Schema::hasColumn('sales_consultations', 'gcs_uri')) {
            Schema::table('sales_consultations', function (Blueprint $table) {
                $table->string('gcs_uri', 500)->nullable()->after('duration')->comment('GCS 저장 URI');
            });
        }
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('sales_consultations', function (Blueprint $table) {
            $table->dropColumn('gcs_uri');
        });
    }
};
