<?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
    {
        if (
            Schema::hasColumn('lokasi_tps', 'id_lokasi_tps') &&
            !Schema::hasColumn('lokasi_tps', 'id_tps')
        ) {
            Schema::table('lokasi_tps', function (Blueprint $table) {
                $table->renameColumn('id_lokasi_tps', 'id_tps');
            });
        }
    }

    public function down(): void
    {
        
    }
};
