<?php
// database/migrations/2026_04_14_000000_add_sertifikat_to_tracer_study_table.php

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

return new class extends Migration
{
    public function up()
    {
        Schema::table('tracer_study', function (Blueprint $table) {
            $table->dropColumn(['tempat_lahir', 'tanggal_lahir']);
            $table->json('sertifikat')->nullable()->after('memiliki_sertifikat');
        });
    }

    public function down()
    {
        Schema::table('tracer_study', function (Blueprint $table) {
            $table->string('tempat_lahir')->nullable();
            $table->date('tanggal_lahir')->nullable();
            $table->dropColumn('sertifikat');
        });
    }
};